FPM: Return 404 if the fcgi request is without SCRIPT_FILENAME#6466
FPM: Return 404 if the fcgi request is without SCRIPT_FILENAME#6466bukka wants to merge 1 commit intophp:PHP-7.4from
Conversation
91e13a9 to
bbd6fac
Compare
|
I think we should return 5xx for an invalid request. |
|
Invalid |
|
Why is that script_path_translated check there at all? The comment says it allows specifying the script via argv, but I don't think FPM supports that, right? This code was copy&pasted from init_request_info in sapi/cgi/cgi_main.c, and I think the condition was just copied over even though it does not make sense in the FPM context. |
|
The check seems to be mostly useful to save some cycles as the processing can basically end if it's null and but that's more minor optimization unrelated to the fix... |
nikic
left a comment
There was a problem hiding this comment.
I think it would be good to at least fix the comment.
|
Comment updated and merged via a221e17 |
|
Hello. Could you say, please, in what release it will be included? 7.3, 7.4, 8.0? upd: Oh, I see a Many thanks for the fix! |
This PR fixes bug 69625. The reason is that
(SG).request_methoddid not get set becausescript_path_translatedwas empty. The fix setsrequest_methodfirst so it has got value even ifSCRIPT_FILENAMEis empty. That will keep the behavior for emptyREQUEST_METHODbut fixes it for emptySCRIPT_FILENAME.