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
Following #646, proxyRequest ignores any Accept headers.
This is breaking my application (following a nuxt upgrade from 3.9 -> 3.11) as we proxy api requests via the server to a backend API, which requires us to send through an Accept header.
As a fix for the timebeing I can explicitly pass through the Accept header as follows
I too believe this was a bit of breaking change and doesn't work as expected. I'm using nuxt's routeRules to specify proxies and I don't think there's any way to manually forward headers from there. For API responses, I can probably hard code it:
I want the backend to be able to determine what the browser supports. Currently it always responds with the fallback format instead of modern ones like avif even if the browser support them because that info is removed while proxying.
For the time being, creating a middleware for proxying and calling proxyRequest like OP wrote seems to work.
Environment
Node 18.16.1
Reproduction
N/A
Describe the bug
Following #646, proxyRequest ignores any
Accept
headers.This is breaking my application (following a nuxt upgrade from 3.9 -> 3.11) as we proxy api requests via the server to a backend API, which requires us to send through an
Accept
header.As a fix for the timebeing I can explicitly pass through the
Accept
header as followsbut this feels a bit unnecessary to me, I would have expected h3 to send through this header by default.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: