How to proxy image with http-proxy-middleware? #739
kopax-polyconseil
started this conversation in
General
Replies: 1 comment
-
Did you try the Here is an example with image manipulation: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
We are proxying a whole SPA website using Node.jS with
http-proxy-middleware
in order to edit<meta />
tag for social network on two specific routes.Probleme
Using Google Chrome, this is a
.png
file retrieved without using the proxy : https://app.staging.passculture.team/images/app-icon-512px.pngThis is the same
.png
file with the proxy : https://app.testing.passculture.team/images/app-icon-512px.pngWe expect the MIME content type to be set like with the first URL in our proxy, instead it use
res['content-type'] = 'text/html'
It results in Google chrome displaying this :
The proxy should behave like in the first example link.
By reading the documentation of
http-proxy-middleware
, I don't find how to serve images without issue.Reproduction
Open with chrome
http://localhost:8080/images/app-icon-512px.png
Question
How can I fix the proxy ?
Beta Was this translation helpful? Give feedback.
All reactions