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

Hitting JSON endpoint with valid "style" param causes timeout and 5xx error #1577

Closed
movermeyer opened this issue Mar 16, 2018 · 2 comments
Closed

Comments

@movermeyer
Copy link

movermeyer commented Mar 16, 2018

I was trying out using the style parameter:

https://img.shields.io/pypi/format/pycparser.svg?style=plastic

Which worked fine, as expected.

I then wanted to try the other output formats. I switched the URL to point at the JSON endpoint:

https://imgshieldsio/pypi/format/pycparser.json?style=plastic (replaced img.shields.io with imgshieldsio)

Which causes various 5xx errors. The first time I tried, I got a 520, and the second time, I got Cloudflare's 524:

image

This seems to be a result of the extra ?style=plastic parameter, as the error disappears when I remove it.
Interestingly, this timeout doesn't happen for invalid params (?abc=123), nor invalid styles (?style=abc)

You may want to configure the server to ignore the style parameter for the json format.

I'm letting you know since I was worried that someone might be able to DDOS shields.io by sending requests that use more than their fair share of server resources.

@movermeyer movermeyer changed the title Hitting JSON endpoint with extra params causes timeout and 5xx error Hitting JSON endpoint with valid "style" param causes timeout and 5xx error Mar 16, 2018
@platan
Copy link
Member

platan commented Mar 16, 2018

@movermeyer Thank you for reporting this. You're right and this request causes server process crash. This is a known bug #1348 and was fixed in #1429. We have to wait for deployment.
I've changed domain name from img.shields.io to imgshieldsio in URL you provided, just in case.

@platan platan closed this as completed Mar 16, 2018
@paulmelnikow
Copy link
Member

We're tracking deploy status in #1538 😄

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

No branches or pull requests

3 participants