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

Fix getHeader to be case-insensitive #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 14, 2017

  1. fix getHeader to be case-insensitive

    www.campman.com returns the  "X-BC-ApiLimit-Remaining" header in all lower-case, like "x-bc-apilimit-remaining".   The getRequestsRemaining can not find the header, and returns 0 as the limit every time.  I patched the getHeader function so it will look for the header key using a case-insensitive search, if it can't find an exact match using the hash lookup.  Now, getRequestsRemaining returns the expected number of API requests remaining.  Note that RFC2616 states that field names in the HTTP header are case-insensitive, so this is the correct thing to do.
    atensoftware authored Apr 14, 2017
    Configuration menu
    Copy the full SHA
    86ac739 View commit details
    Browse the repository at this point in the history