change the Referer header or give a option to do this
Directly passed.
See https://github.com/webpack/webpack-dev-server/issues/1151
Try using the headers option to supply your own referer header.
As documented in https://github.com/chimurai/http-proxy-middleware#http-proxy-options
Oh I just think headers option is that from server to client...
We need change the header like way of changeOrigin option, tell me if I got something wrong
headers option is to change the headers between client to server.
referer can be basically any url. Not sure how you want to change that similar to changeOrigin.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer
Perhaps you can explain your use case a bit?
I've read that. Maybe I'm just not clear about what I am doing...
I got a js file, and use it in this way:
...
script.src = 'http://example/a/b/test.js'
...
And how am I supposed to write the proxy to change its referer.
@SidKwok were you ever able to solve that? I'm having the exact same issue.
@joaocraveriro it can鈥檛 be solved. It is a http request, webpack can鈥檛 proxy a http request. You can try to change headers via chrome extensions
So what are we supposed to do if our backend enforces referer check??
Most helpful comment
So what are we supposed to do if our backend enforces referer check??