Skip to content

Make sure header keys are always lowercase #143

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

Merged
merged 1 commit into from
Feb 28, 2020
Merged

Conversation

n3o77
Copy link
Contributor

@n3o77 n3o77 commented Feb 21, 2020

Since http2 header field names must be lowercase ( https://httpwg.org/specs/rfc7540.html#HttpHeaders ) but if curl uses a lower http version the field names are in mixed case. I noticed as on our live system the prev. and next links couldn't be found as with http1.1 they're in the field Link instead of link. So it makes sense to always make sure they're lower case for consistency.

@hippoduck
Copy link

Can confirm I also have this issue.

@tareqtms tareqtms merged commit 636ecf2 into phpclassic:master Feb 28, 2020
@andyexeter
Copy link
Contributor

Hello,

Unfortunately this is a breaking change. By converting all header keys to lowercase, this no longer works:

$limitHeader = explode('/', $response->getHeader('X-Shopify-Shop-Api-Call-Limit'), 2);

I will create a PR which converts the key to lowercase within the getHeader method.

andyexeter added a commit to andyexeter/php-shopify that referenced this pull request Oct 12, 2020
tareqtms added a commit that referenced this pull request Dec 5, 2020
Fix bug introduced by #143 by lowercasing key in getHeader
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.

4 participants