Skip to content

Add workaround for non PSR-7 compliant headers in SlimPhp #7

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
Nov 15, 2018

Conversation

schmengler
Copy link
Contributor

@schmengler schmengler commented Nov 14, 2018

Slim normalizes headers when creating them from the environment but preserves the capitalized HTTP_ prefixed values from the $_SERVER array as original keys¹. $headers->all() then uses the original keys which makes the Guzzle client use them as actual header names.

So we need to remove the original keys by setting all values again with their normalized keys.

¹) Known issue: slimphp/Slim-Psr7#11

Copy link

@wigman wigman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This like these drive you crazy, don’t they:)
Happy you found it!

@schmengler schmengler merged commit 0440467 into master Nov 15, 2018
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