mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix #81305: Built-in Webserver Drops Requests With "Upgrade" Header
While our HTTP parser supports upgrade requests, the code using it does not. Since upgrade requests are only valid for HTTP/1.1 and we neither support any higher version, nor HTTPS yet, we do not exit early in case of such requests, i.e. we ignore them, what is allowed by the specs. We keep the supporting code in case we can meaningfully support upgrade requests in the future. Closes GH-7316.
This commit is contained in:
parent
98049e8b9a
commit
d1ccb5bd0c
3 changed files with 43 additions and 0 deletions
|
@ -1339,11 +1339,16 @@ size_t php_http_parser_execute (php_http_parser *parser,
|
|||
}
|
||||
}
|
||||
|
||||
/* We cannot meaningfully support upgrade requests, since we only
|
||||
* support HTTP/1 for now.
|
||||
*/
|
||||
#if 0
|
||||
/* Exit, the rest of the connect is in a different protocol. */
|
||||
if (parser->upgrade) {
|
||||
CALLBACK2(message_complete);
|
||||
return (p - data);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (parser->flags & F_SKIPBODY) {
|
||||
CALLBACK2(message_complete);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue