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
I would like to use transformRequest for retrieving assets through an rpc connection between a worker and the Vite dev server.
My issue is that transformRequest doesn't return the content-type of the result. I need to set the right content-type in the response sent to the browser.
An alternative would be to support passing a standard Request to the vite middlewares, returning a standard Response. #15389
This is not a blocker. I can always just proxy the requests through http between browser<->worker<->vite.
Suggested solution
Add contentType to the transformRequest return type.
Alternative
Support passing a standard Request to the vite middlewares, returning a standard Response. #15389
I remember there's .css?direct (which I think vike uses?) but this might be the only odd ball which returns text/css content type. If that's the case, then you could check ?direct on your runtime? If that's not the case, then I wonder what's the other possible content types.
Description
I would like to use
transformRequest
for retrieving assets through an rpc connection between a worker and the Vite dev server.My issue is that
transformRequest
doesn't return the content-type of the result. I need to set the right content-type in the response sent to the browser.An alternative would be to support passing a standard
Request
to the vite middlewares, returning a standardResponse
. #15389This is not a blocker. I can always just proxy the requests through http between browser<->worker<->vite.
Suggested solution
Add
contentType
to thetransformRequest
return type.Alternative
Support passing a standard
Request
to the vite middlewares, returning a standardResponse
.#15389
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: