Bug #81496 [NEW]: CLI server logs wrong request method

From: Date: Sun, 03 Oct 2021 09:25:58 +0000
Subject: Bug #81496 [NEW]: CLI server logs wrong request method
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236989@lists.php.net to get a copy of this message
From: lauri dot kentta at gmail dot com Operating system: PHP version: 8.0.11 Package: Built-in web server Bug Type: Bug Bug description:CLI server logs wrong request method Description: ------------ In the CLI server, request_info is populated only for scripts. If you start by fetching a static file, the server logs request_method as "(null)", and later it logs whatever method was used for latest script. 404 response is also affected. There's two ways to fix this, either populate request_info for all requests or simply change logging to use client->request.request_method instead. Test script: --------------- <!DOCTYPE html> <script> (async function() { await fetch("static.html"); await fetch("script.php", {method: "POST"}); await fetch("static.html"); })(); </script> Expected result: ---------------- Server log with methods GET, POST, GET. Actual result: -------------- Server log with methods (null), POST, POST, if the files exist. Server log with methods (null), (null), (null), if files do NOT exist (404). -- Edit bug report at https://bugs.php.net/bug.php?id=81496&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=81496&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=81496&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=81496&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=81496&r=needscript Try newer version: https://bugs.php.net/fix.php?id=81496&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=81496&r=support Expected behavior: https://bugs.php.net/fix.php?id=81496&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=81496&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=81496&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=81496&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=81496&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=81496&r=dst IIS Stability: https://bugs.php.net/fix.php?id=81496&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=81496&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=81496&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=81496&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=81496&r=mysqlcfg

« previous php.bugs (#236989) next »