You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP 8.3.14 (cli) (built: Nov 21 2024 08:25:00) (NTS)
Bug description
When I have a file with a questionmark in my Laravel app public folder, e.g. Road?.jpg and I try to open http://site.test/Road%3F.jpg this won't work. I will return a 404 page but not the nice page Laravel usually returns but a plain text 404 not found from Nginx itself. When the site/file is uploaded to a real server (a Forge server in my case) it works just fine. Might be some herd/nginx config thing locally?
Steps to reproduce
Create a new Herd site, place a jpeg image file called 'Road?.jpg' in the (public) root and try to open sitename.test/Road%3F.jpg
Relevant log output
For some reason the /Users/xxx/Library/Application\ Support/Herd/Log/nginx-error.log shows:
2024/12/09 11:30:29 [error] 27821#2419520: *14 "Users/xxx/Documents/Sites/sitename/Road/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: sitename.test, request: "GET /Road%3F.jpg HTTP/2.0", upstream: "fastcgi://unix:/Users/xxx/Library/Application Support/Herd/herd.sock", host: "sitename.test"
But only when I add %3F in url, looks like Herd/Nginx is parsing %3F as a regular ? questionmark
The text was updated successfully, but these errors were encountered:
This seems to be an issue in how nginx handles the static files url encoding.
I need to investigate if this is going to cause any trouble down the line, but in the meantime you can fix this by using a local valet driver.
Just put this code in a file called LocalValetDriver.php in the root of your project 👍
Thanks @mpociot! Had to use rawurlencode in the isStaticFile function for folders containing quotes. But this works for now. Hope you can find a more solid solution.
Platform
macOS
Operating system version
MacOS Sequoia 15.1.1 (24B91)
System architecture
ARM64 (M1, M2, etc)
Herd Version
1.13.0 (Build 37)
PHP Version
PHP 8.3.14 (cli) (built: Nov 21 2024 08:25:00) (NTS)
Bug description
When I have a file with a questionmark in my Laravel app public folder, e.g. Road?.jpg and I try to open http://site.test/Road%3F.jpg this won't work. I will return a 404 page but not the nice page Laravel usually returns but a plain text 404 not found from Nginx itself. When the site/file is uploaded to a real server (a Forge server in my case) it works just fine. Might be some herd/nginx config thing locally?
Steps to reproduce
Create a new Herd site, place a jpeg image file called 'Road?.jpg' in the (public) root and try to open sitename.test/Road%3F.jpg
Relevant log output
The text was updated successfully, but these errors were encountered: