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

Repeated format causes Bad Gateway #81

Closed
pevans-gfz opened this issue Mar 21, 2024 · 1 comment
Closed

Repeated format causes Bad Gateway #81

pevans-gfz opened this issue Mar 21, 2024 · 1 comment
Assignees
Milestone

Comments

@pevans-gfz
Copy link
Collaborator

Poorly formed query strings result in a 502 response:

  1. Successful request:
$ curl "https://geofon.gfz-potsdam.de/eidaws/routing/1/query?service=station&net=GE&format=post"
https://geofon.gfz-potsdam.de/fdsnws/station/1/query
GE * * * 1993-01-01T00:00:00 2024-03-22
  1. Unsuccessful:
$ curl "https://geofon.gfz-potsdam.de/eidaws/routing/1/query?service=station&net=GE&format=text&format=post"
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.24.0</center>
</body>
</html>

This request has format=text&format=post in the query string.
Similarly:

https://geofon.gfz-potsdam.de/eidaws/routing/1/query?service=station&format=post&format=post
https://geofon.gfz-potsdam.de/eidaws/routing/1/query?format=post&service=station&net=GE&format=text
https://geofon.gfz-potsdam.de/eidaws/routing/1/query?service=station&net=GE&format=text&format=post
https://geofon.gfz-potsdam.de/eidaws/routing/1/query?service=station&net=GE&format=post&format=post
https://geofon.gfz-potsdam.de/eidaws/routing/1/query?format=post&format=post"
https://geofon.gfz-potsdam.de/eidaws/routing/1/query?format=x&format=x"
and
https://geofon.gfz-potsdam.de/eidaws/routing/1/query?service=station&service=station

all respond with 502.

Returning "Bad Gateway" to poor user input is confusing, especially as other requests are still accepted and responded to.
The second set of requests should get a 'user error' response, like "400 Bad Request" perhaps.
Interestingly,

https://geofon.gfz-potsdam.de/eidaws/routing/1/query?format=x

(one format argument) does get a 400 response.

@javiquinte javiquinte self-assigned this Jan 3, 2025
@javiquinte javiquinte added this to the 1.2.3 milestone Jan 3, 2025
@javiquinte
Copy link
Collaborator

Fixed in commit 1194bae

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

2 participants