-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
request: remove 404 HTTP status code on failed npm requests #514
Comments
Are you sure that the actual response status code is 404? I did a quick test using:
and got back badge with 500 instead 😕 |
My mistake, I meant 500. (Got confused since the text displays 404). Would like it to return 200 instead, because it's responding with an image worth displaying/embedding. |
With that being said I don't know what @amio thinks about it but to me, it makes sense to go with a successful response code with an on-badge error indication due to reasons you just explained and because shields.io does the same. |
Error handling in general needs some love 🙃 |
Overall I'm agree with this 👍 IIRC GitHub would cache image with status code 200 for hours, that's the reason I made it an error response, to prevent GitHub cache an incorrect badge. |
When using getting the npm monthly downloads, new packages return a 404 HTTP status. For example: https://badgen.net/npm/dm/fs.promises.exists
The 404 HTTP status code prevents the image from being embedded at all, showing a broken image instead:
I would much rather have the 404 npm badge displayed (via HTTP status code 200) temporarily than a broken image embed.
Is it possible to remove the 404 status code?
Happy to PR if so.
The text was updated successfully, but these errors were encountered: