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

Everything is an NaN now #1

Closed
bigomega opened this issue Jul 15, 2015 · 15 comments
Closed

Everything is an NaN now #1

bigomega opened this issue Jul 15, 2015 · 15 comments

Comments

@bigomega
Copy link

No description provided.

@ruddfawcett
Copy link
Owner

Interesting... I just tried it locally, and I get a non NaN result. However, it doesn't seem to be working on Heroku -- and the GitHub API hasn't changed, and the function didn't break.

I'll look into this more and get back to you.

@bigomega
Copy link
Author

Something's fishy in heroku.
Yes, please get back when you get the chance 😊

@thatsIch
Copy link

thatsIch commented Oct 5, 2015

Sadly still not working

@bogdanRada
Copy link
Contributor

+1. Would love to see this fixed. I use this in all my projects.

I would gladly help solve this issue, but i think it's a problem with the server on heroku.com. I checked your code locally and works fine. Probably the server just needs to be restarted, maybe it crashed

Or maybe is the fact that you don't send any header related to cache control as a response. I think if you send this headers everything will start working again:

Cache-Control: no-cache, no-store, must-revalidate, max-age:0
 Expires: -1

you can see this github/markup#224 for more information on that.

@bogdanRada
Copy link
Contributor

i updated my last comment. Can you please check that ? I think will solve this problem. Thank you very much

@ruddfawcett
Copy link
Owner

I apologize for my negligence on this issue. This should be fixed. Thanks @bogdanRada!

@ruddfawcett
Copy link
Owner

This still seems to be an issue...

It looks like the problem lies with Heroku. I am using a cedar-14 stack, and there are no errors in the logs. Restarting the server with heroku restart works temporarily, but then NAN is returned again. I'll look into it further.

@bogdanRada
Copy link
Contributor

Yeah. I think i know why. Currently HTTP protocol on shields.io redirects to HTTPS. Can you try changing the url to HTTPS? I forgot about that

@bogdanRada
Copy link
Contributor

The error happens because HTTP ons shields.io returns now Content-type text/html.

@ruddfawcett
Copy link
Owner

@bogdanRada switched to HTTPS -- still NAN 😞.

@bogdanRada
Copy link
Contributor

Thats strange :(

@bogdanRada
Copy link
Contributor

I suspect why is happening. I had same issue on my repository http://github.com/bogdanRada/ruby-gem-downloads-badge. All my badges died when shields.io was switched on cloudflare which uses SNI for SSL connections. Maybe using curl instead of file_get_contents will fix the problem.

@bogdanRada
Copy link
Contributor

Also i think you should see this discussion. It seems github introduces rate limiting. badges/shields#529 and i think now your application will have to do autenticated requests to their API in order to work properly

@bogdanRada
Copy link
Contributor

I think this will be solved by this pull request: #3 . Hope it helps :)

@ruddfawcett
Copy link
Owner

Closed by #3.

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

4 participants