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 #245

Merged
merged 2 commits into from
Jan 10, 2019

Conversation

atensoftware
Copy link
Contributor

On certain BigCommerce stores, getHeader fails because the X-BC-ApiLimit-Remaining header is all lower-case in the HTTP response. This causes getRequestsRemaining to always return 0 and puts the code into an infinite wait for more requests. Instead, change getHeader to do a case-insensitive search for the header if the exact case is not found. Please merge this into the trunk. The code keeps breaking every time I update the library.

I had created a previous pull request to fix this, but I don't think it got fixed:
#196

On certain BigCommerce stores, getHeader fails because the X-BC-ApiLimit-Remaining header is all lower-case in the HTTP response.  This causes getRequestsRemaining to always return 0 and puts the code into an infinite wait for more requests.  Instead, change getHeader to do a case-insensitive search for the header if the exact case is not found.  Please merge this into the trunk.
@lord2800
Copy link
Contributor

Hey, thanks for fixing this (again)! Can you take a look at the Travis failures?

@atensoftware
Copy link
Contributor Author

Travis was just complaining about spacing. I fixed it.

@lord2800 lord2800 merged commit adcafe4 into bigcommerce:master Jan 10, 2019
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

Successfully merging this pull request may close these issues.

2 participants