-
Couldn't load subscription status.
- Fork 720
Description
- Valet Version: 3.1.6
- PHP Version: 8.1.6
Description:
My Laravel app is located in ~/Sites/MySite. I used valet park within the ~/Sites directory to set it up, with a clean installation earlier today.
After running valet share, all requests through the ngrok URLs would simply return a 404 page. It wasn't a 404 page I recognised (i.e. not my app's), but the ngrok web interface showed they were from Valet.
All requests would 404. Here are some examples headers from ngrok's UI:
GET / HTTP/1.1
Host: MySite.test
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en;q=0.9
Upgrade-Insecure-Requests: 1
X-Forwarded-For: 81.169.204.198
X-Forwarded-Proto: http
X-Original-Host: 63cb-82-159-204-198.ngrok.io
The one bit that stood out was Host: MySite.test. Not sure why, just a hunch, but starting afresh from a lower-case directory fixes it.
I've been using Valet with a MySite directory for months with no issues, but today was the first time I tried valet share, so I assume this is specific to how Valet interacts with ngrok.
I'm on macOS Monterey 12.3.1. My drive is formatted as APFS (Encrypted), so no case-sensitivity.
Steps To Reproduce:
- Make a directory called
~/Sites/MyWebsiteWithCapitalLettersand load some test code in there. - Run
cd ~/Sites && valet park - Run
cd ~/Sites/MyWebsiteWithCapitalLetters && valet share - Visit the ngrok URLs, you should see a very sparse 404 page
- Stop sharing, run
cd ~/Sites && valet forget - Rename the directory to
~/Sites/mywebsitewithcapitalletters - Repeat steps 2 – 4, this time the site should be served correctly