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 is replacing part of address with an empty string #4635

Closed
jmacura opened this issue Jan 17, 2024 · 2 comments · Fixed by #4654
Closed

Proxy is replacing part of address with an empty string #4635

jmacura opened this issue Jan 17, 2024 · 2 comments · Fixed by #4654
Assignees
Milestone

Comments

@jmacura
Copy link
Collaborator

jmacura commented Jan 17, 2024

Bug

Describe the bug
When a path to proxy is provided as a relative path, the proxy incorrectly throws away part of the original address resulting in an invalid URL.

To Reproduce
...

Expected behavior
The URL gets only encoded, no parts are dropped.

Screenshots

Additional context
observable on hub4everybody.com and watlas.lesprojekt.cz

@jmacura
Copy link
Collaborator Author

jmacura commented Jan 30, 2024

Discovered so far:

  • only happens with hslayers-server on hub4everybody, watlas
  • not replicable on localhost
  • not replicable with a different type of proxy server
  • only happens when the URL is a WMS service from ArcGIS server
  • not replicable on non-ArcGIS WMS servers
  • the URL returned in GetCapabilities document is changed to the hostname of requesting server (h4e, watlas, ...), i.e. <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://watlas.lesprojekt.cz/arcgis2/services/dmr4g/ImageServer/WMSServer"/>
  • x-forwarded-for , x-forwarded-host and x-forwarded-server HTTP headers are added to the request when sent
  • sec-fetch-site HTTP header is cross-site on localhost but same-origin on the public server

@jmacura
Copy link
Collaborator Author

jmacura commented Jan 31, 2024

Update:

  • seems to be caused by the X-Forwarded-Host HTTP header
  • the "xfwd": "false" option in http-proxy seems ineffective (the x-forwarded-* headers are appended anyway)

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

Successfully merging a pull request may close this issue.

2 participants