-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Getallheaders fpm #904
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
Getallheaders fpm #904
Conversation
1183859
to
a3674b5
Compare
As this PR introduce a new function, it will be nice to include a unit test (5.6+) |
@remicollet indeed, will do. I learned less than an hour ago that fpm had tests now! :) Thanks for your work on this. |
As discussed together, I will make another PR for master, since some functions are not compatible anymore, namely |
And FYI, I just add 017.phpt which is the first one to run some specific code inside the FPM server. |
Hmmm how should I handle the fact that this PR is for php-5.5, but the tests are for php-5.6 only? |
apache_request_headers / getallheaders functions are available in nsapi, apache*, cli server, cgi and litespeed, so make sense for FPM. All other SAPI use PHP_FALIAS(getallheaders, apache_request_headers, |
I also think having cgi_add_request_header and fpm_add_request_header is a bit tricky
We'll just have to be careful during the merge (probably merging all in 5.6 and cherry-pick only the revelant commit in 5.5) |
Will do.
How do I pass the correct value? It's used as a function callback, so I need an intermediary function.
I'll let you handle it then :-) |
89a1827
to
3516803
Compare
The failed tests don't really seem related to this PR... |
@remicollet I fixed:
The PR #910 adds the missing test. |
3516803
to
e0bfbf4
Compare
Seems like this change normalizes the case of the headers, as well as leaves off the last character. At least that's what it did when I patched my source. Shouldn't the headers come through as-is rather than the case changed? |
It'd be better to preserve case, definitely. For the CLI server |
In its case, all headers were stored in an array with lowercase keys for retrieval. The solution was to add a second array with original-case keys which pointed to the same values. |
Of course keeping a standard list of http headers is impossible in the case where developers are adding custom headers in their web applications. @TazeTSchnitzel So in this case, normalization is probably the best policy when dealing with fpm. Do you agree? If so I think Title case is the wrong approach -- something more like you've implemented with cli (lower case) would be more appropriate. |
I'm not familiar with the intricacies of FastCGI, but are you sure case normalisation is the only way to go? Bear in mind this won't work properly anyway as the rules have exceptions. |
Honestly my understanding of this type of development is very elementary. I just wanted to post and indicate that while this pull request is submitted, when I applied it to my source, the resulting getallheaders output had the following issues:
Thanks for your attention. If I'm in err please let me know. |
It seems this PR can be closed, because PHP 5.5 is in security support mode, and there's the follow-up PR #910 which targets PHP 5.6. |
Following up on #523 , fixed the comments by refactoring and fixing the trailing character.
Reminder: fixes https://bugs.php.net/bug.php?id=62596
(Since it's a follow-up, cc @krakjoe @TazeTSchnitzel @manuelm)