You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error occurs during request handling (e.g. throw createError({statusCode:500,statusMessage:'SomeError'}))
The default nitro error handler is used.
The request is made with the Fetch API; but really: the request has sec-fetch-mode set to cors.
Then the request over-assumes that the request is JSON, and sending an Accept header set to text/html does not coerce the response to HTML, it remains JSON.
Environment
Affects latest version of nitro, the project I am working on has
nitropack@2.7.2
.Reproduction
Stackblitz minimal example
Describe the bug
Preconditions:
throw createError({statusCode:500,statusMessage:'SomeError'})
)sec-fetch-mode
set tocors
.Then the request over-assumes that the request is JSON, and sending an
Accept
header set totext/html
does not coerce the response to HTML, it remains JSON.Additional context
The related check in
isJsonRequest
Logs
The text was updated successfully, but these errors were encountered: