| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 Patches0001-Fix-81496-CLI-server-logs-wrong-request-method.txt (last revision 2021-10-03 09:28 UTC by lauri dot kentta at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2021-10-03 09:28 UTC] lauri dot kentta at gmail dot com
  [2021-10-05 06:44 UTC] git@php.net
  [2021-10-05 06:44 UTC] git@php.net
 
-Status: Open
+Status: Closed
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 06:00:01 2025 UTC | 
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).