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
When configuring the proxy setting in package.json to a string, requests to should not changeOrigin as false is the default setting in node-http-proxy.
I have a file server running tus-node-server sitting behind my application server that I proxy to for file uploads and downloads. Tus by default reads the origin header to dynamically generate a location to ask the client to send requests to going forward.
I had to spend some time debugging the problem I was having where my file server was sending back locations that were relative to my application server and not the client. While the fix is simple enough, it was not documented, nor is it the default behavior for the packages running the proxy under the hood.
I'm not sure why a system would want to change the default behavior seeing as this is a proxy. Wouldn't all consumers of the proxied request want to know the original origin by default? I don't know what value there is in masking it.
Ultimately, I would like to either have the CRA default match the underlying tooling defaults or at the very least have documentation helping advanced proxy users know that CRA alters the default behavior without them having to read the CRA source code.
Looks like this is no longer an issue as it appears the proxy key in package.json has been removed in v2 in favor of the more flexible proxySetup.js. If that is the case, this issue is no longer valid. Thanks!
Activity
Timer commentedon Sep 26, 2018
Can you explain this more? What behavior does this turn on? Why is it bad?
SavePointSam commentedon Sep 26, 2018
I have a file server running tus-node-server sitting behind my application server that I proxy to for file uploads and downloads. Tus by default reads the origin header to dynamically generate a location to ask the client to send requests to going forward.
I had to spend some time debugging the problem I was having where my file server was sending back locations that were relative to my application server and not the client. While the fix is simple enough, it was not documented, nor is it the default behavior for the packages running the proxy under the hood.
I'm not sure why a system would want to change the default behavior seeing as this is a proxy. Wouldn't all consumers of the proxied request want to know the original origin by default? I don't know what value there is in masking it.
Ultimately, I would like to either have the CRA default match the underlying tooling defaults or at the very least have documentation helping advanced proxy users know that CRA alters the default behavior without them having to read the CRA source code.
SavePointSam commentedon Sep 26, 2018
Looks like this is no longer an issue as it appears the
proxykey in package.json has been removed in v2 in favor of the more flexibleproxySetup.js. If that is the case, this issue is no longer valid. Thanks!gaearon commentedon Sep 27, 2018
There's still support for a "simple"
proxykey, but indeed advanced configuration is now fully flexible.SavePointSam commentedon Sep 27, 2018
It may be worthwhile to note this in the guide then. 🤷♂️
gaearon commentedon Sep 27, 2018
Added to #5127.
gaearon commentedon Sep 27, 2018
You're also welcome to PR :-)
SavePointSam commentedon Sep 27, 2018
I probably will! haha