Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxy removes double slashes "//" automatically #880

Closed
Emad-Emami opened this issue Apr 19, 2017 · 4 comments
Closed

proxy removes double slashes "//" automatically #880

Emad-Emami opened this issue Apr 19, 2017 · 4 comments

Comments

@Emad-Emami
Copy link

I'm using this proxy config for my react application:
proxy: { "/etc/api/": { "target": "http://www.example.com/etc/api/", pathRewrite: { '^/etc/api/' : '' }, changeOrigin: true, secure: false } }
but in some conditions my app sends some get requests which has double slash in URL like (before "key"):
http://www.example.com/etc/api/getlists//key/45b2606d86dfbdef2bfaed0b5eb5450ac2b8f8da
It seem proxy method removes "//" automatically. why? is it on purpose or bug?

@jtesser
Copy link

jtesser commented Apr 21, 2017

I have the same exact issue
config is
'/api': {
target: 'http://localhost:8080',
changeOrigin: false
},

and I send /api/v1/browsertree/sitename/demo.dotcms.com/uri//
BUT I get this at the webserver
/api/v1/browsertree/sitename/demo.dotcms.com/uri/

@fmontes
Copy link

fmontes commented Apr 21, 2017

I'm having the same issue... maybe there is an option we are missing?

@bebraw
Copy link
Contributor

bebraw commented May 14, 2017

It uses http-proxy-middleware underneath. Could you try to set up a standalone test case against that so we can rule out a WDS bug?

@shellscape
Copy link
Contributor

Closing due to age and inactivity. If someone is able to put together a test case in a repo we can use to reproduce, we'll revisit this one.

jri added a commit to dmx-systems/dmx-platform that referenced this issue Oct 1, 2017
BREAKING CHANGE

The create-workspace request changed:
```
POST /workspace?name=...&uri=...&sharing_mode_uri=...
```

Instead of path params query params are used now.
`uri` is optional.

Background: the proxy of the webpack-dev-server accidentally converts double slashes, as caused
by empty path segments, into single slash, resulting in a changed (= corrupted) URL semantics.
webpack/webpack-dev-server#880

See #1080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants