Bug #81305 [NEW]: Development Webserver Drops Requests With "Upgrade" Header

From: Date: Wed, 28 Jul 2021 03:37:36 +0000
Subject: Bug #81305 [NEW]: Development Webserver Drops Requests With "Upgrade" Header
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235419@lists.php.net to get a copy of this message
From: parsonswy at gmail dot com Operating system: Windows PHP version: 8.0.8 Package: Built-in web server Bug Type: Bug Bug description:Development Webserver Drops Requests With "Upgrade" Header Description: ------------ The development server appears to discard any HTTP requests that have the "Upgrade" header as malformed. I couldn't find information on what HTTP spec the server is built to support, if any. Actually implementing the HTTP upgrade protocol seems overkill for the scope of the server. Having it at least accept the request and ignore the upgrade offer I think is still spec compliant and preferable to generic discard and socket close. Alternatively, responding with HTTP/BAD_REQUEST and documenting the behavior is a more transparent option. I have confirmed that my client was indicating HTTP/1.1 so the 'Upgrade' header should still be legal on the request. I don't actually need to use HTTP/2, I had a Java client that I was testing which requested an upgrade by default and this was a difficult issue to debug. Tested on PHP/8.0.3 (Native Windows & alpine docker), PHP/8.0.8 alpine docker. Test script: --------------- Succeeds: curl "http://localhost:8081" --trace-ascii - -X GET Fails "Invalid request (Malformed HTTP request)": curl "http://localhost:8081" --trace-ascii - -X GET -H "Upgrade: HTTP/2.0" -H "Connection: upgrade" -- Edit bug report at https://bugs.php.net/bug.php?id=81305&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=81305&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=81305&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=81305&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=81305&r=needscript Try newer version: https://bugs.php.net/fix.php?id=81305&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=81305&r=support Expected behavior: https://bugs.php.net/fix.php?id=81305&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=81305&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=81305&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=81305&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=81305&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=81305&r=dst IIS Stability: https://bugs.php.net/fix.php?id=81305&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=81305&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=81305&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=81305&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=81305&r=mysqlcfg

« previous php.bugs (#235419) next »