ead10f1f81
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
7 lines
226 B
JavaScript
7 lines
226 B
JavaScript
export default function handler(req, res) {
|
|
if (req.query.invalid) {
|
|
// test the warning when content is added for a 204 response
|
|
return res.status(204).json({ hello: 'world' })
|
|
}
|
|
return res.status(204).send()
|
|
}
|