Commit graph

3 commits

Author SHA1 Message Date
Hassan El Mghari
26c40f3186
Add heading to invalid-api-status-body error (#34150) 2022-02-09 21:01:58 -06:00
Balázs Orbán
b7725133f8
docs: recommend .end instead of .send when no body is being sent (#33611)
Fixes #33536

I was thinking to make `body` optional here instead:

2c6bd1ed1b/packages/next/shared/lib/utils.ts (L262)

But that might result in more errors when not setting the status code correctly. So it's the easiest for us to just recommend `.end()` which `.send()` uses when there is no argument.

c71465d87a/packages/next/server/api-utils.ts (L269)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-02-03 02:41:28 +00:00
JJ Kasper
ead10f1f81
Fix handling for 204 status code with a body (#28479)
This ensures we handle 204 and 304 status codes correctly in API routes.  

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`

Fixes: https://github.com/vercel/next.js/issues/28464
2021-08-25 15:52:43 +00:00