php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74061 Built-in server assumes path with dot is a file
Submitted: 2017-02-08 14:06 UTC Modified: 2023-02-13 18:22 UTC
Votes:9
Avg. Score:4.1 ± 0.9
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:2 (33.3%)
From: aljosha dot papsch at vinexus dot eu Assigned:
Status: Duplicate Package: Built-in web server
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aljosha dot papsch at vinexus dot eu
New email:
PHP Version: OS:

 

 [2017-02-08 14:06 UTC] aljosha dot papsch at vinexus dot eu
Description:
------------
If the path contains a dot, built-in server assumes it's a file and tries to serve it. Try the test script with the following URLs. Last one will return 404 response but should route to index.php.

$ curl http://localhost:8000/
$ curl http://localhost:8000/O_o
$ curl http://localhost:8000/O.o




Test script:
---------------
<?php
echo "hello, world\n";

Expected result:
----------------
hello, world

Actual result:
--------------
<!doctype html><html><head><title>404 Not Found</title><style>
body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; }
h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em; line-height:2em; border-bottom: 1px inset black; margin: 0; }
h1, p { padding-left: 10px; }
code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;}
</style>
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/ba.z</code> was not found on this server.</p></body></html>

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-04 17:20 UTC] remi@php.net
Should have check for this bug..

So duplicate of #74205, fixed by https://github.com/php/php-src/pull/2403
 [2023-02-13 18:22 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2023-02-13 18:22 UTC] requinix@php.net
Closed in favor of https://github.com/php/php-src/issues/10578
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 22:01:28 2024 UTC