-
Notifications
You must be signed in to change notification settings - Fork 46
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
Fallback for getallheaders() missing #101
Comments
@adriansuter should we include the |
Not sure about that. This would add a dependency that is actually only needed by some users. Probably we could give a hint in the docs. |
I think only write a hint in the docs is not a good solution. The problem is, getallheaders() is an Apache only function, and it works not even in all Apache/PHP configurations (namely PHP via FPM for PHP <7.3) |
Well then we should add that dependency. |
Yeah let's add it as a dep instead of just a dev dep. |
@moritz-h Do you write a PR? |
@l0gicgate Is there a reason why Slim PSR-7 uses |
@adriansuter I can do a PR, but earliest mid of next week. Im on holiday without computer until then. |
@adriansuter actually you added it 3 months ago - #76 😀 |
@danopz the problem is it's added as a dev-dependency and not a regular dependency which means that it doesn't get downloaded when someone requires this package. |
@l0gicgate for sure I know, what I just meant is #112 |
Slim-Psr7 does only show the Host header on systems where
getallheaders()
is missing. My setup is Apache + PHP 7.2 via FPM. But I think there are many other cases, for example using nginx.Slim3 has a fallback to parse the headers from environment in this case. And so do other PSR7 implementations like Nyholm/PSR7: https://github.com/Nyholm/psr7-server/blob/0.3.0/src/ServerRequestCreator.php#L52
Slim 3 example
Result:
Slim 4 example
Result:
The text was updated successfully, but these errors were encountered: