Skip to content

Fix getallheaders function polyfill to respect proper X-GitHub-* headers casing #9

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 25, 2019
Merged

Conversation

SagePtr
Copy link
Contributor

@SagePtr SagePtr commented Feb 22, 2019

In function getallheaders() polyfill done by #5 there was a bug - it converted X-GitHub-Event header as X-Github-Event (because header names are uppercase in $_SERVER array).

Fixed this function to respect correct case for X-GitHub-* headers, which have camel case that were lost in getallheaders polyfill, so the script never respected X-GitHub-Event header when worked under PHP-FPM.

Also, refactored line a bit for better readability.

Plus added missing Content-Type, Content-Length headers which are stored without HTTP_ prefix in $_SERVER array.

@lyquix-owner lyquix-owner merged commit 322d44a into Lyquix:master Feb 25, 2019
@lyquix-owner
Copy link
Member

Thank you!

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