PHP: improved response status code handling.

There's no reason to parse "http_status_line"; the PHP interpreter already
does this.  If the line contains a valid status code, it's assigned to
"http_response_code".

This also fixes invalid status line handling, where the nxt_int_parse()
function returned -1; it was cast to unsigned, yielding response code 65535.
This commit is contained in:
Valentin Bartenev
2019-07-05 18:42:30 +03:00
parent e1de5bcfab
commit 924165c90b
3 changed files with 46 additions and 12 deletions

View File

@@ -0,0 +1,4 @@
<?php
header($_SERVER['HTTP_X_HEADER']);
header('Content-Length: 0');
?>