mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
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
8 lines
226 B
JavaScript
8 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()
|
|
}
|