For issue #5721.
Using wrangler pages dev
for local development does not find files at paths
which require URL decoding and a redirect, e.g. when the pathname contains
%C3%A4
(ä).
# ok
curl -L http://localhost:8788/index.html
# ok (client encodes pathname as `/%C3%A4.txt`)
curl http://localhost:8788/ä.txt
# ok (client encodes pathname as `/%C3%B6`)
curl http://localhost:8788/ö
# ok
curl http://localhost:8788/%C3%A4.txt
# ok
curl http://localhost:8788/%C3%A4/
# [wrangler:inf] GET /%e4/ 404 Not Found
curl -L http://localhost:8788/%C3%A4/index.html
# [wrangler:inf] GET /%e4/ 404 Not Found
curl -L http://localhost:8788/%C3%A4
# [wrangler:inf] GET /%f6 404 Not Found
curl -L http://localhost:8788/ö.html
# [wrangler:inf] GET /%f6 404 Not Found
curl -L http://localhost:8788/ö/
# not found (expected)
curl http://localhost:8788/%E4.txt
It should find the files matching the decoded pathnames.
# ok
curl -L http://localhost:8788/index.html
# ok (client encodes pathname as `/%C3%A4.txt`)
curl http://localhost:8788/ä.txt
# ok (client encodes pathname as `/%C3%B6`)
curl http://localhost:8788/ö
# ok
curl http://localhost:8788/%C3%A4.txt
# ok
curl http://localhost:8788/%C3%A4/
# ok after redirect to `http://localhost:8788/%C3%A4/`
curl -L http://localhost:8788/%C3%A4/index.html
# ok after redirect to `http://localhost:8788/%C3%A4/`
curl -L http://localhost:8788/%C3%A4
# ok after redirect to `http://localhost:8788/%C3%B6`
curl -L http://localhost:8788/ö.html
# ok after redirect to `http://localhost:8788/%C3%B6`
curl -L http://localhost:8788/ö/
# 4xx (graceful handling of malformed URIs)
curl http://localhost:8788/%E4.txt
- Clone the repro repo.
- Install dependencies:
npm install
- Start the server:
npx wrangler pages dev dist
. - In a second terminal run the commands as illustrated for the observed behavior or any alternative to fetch these URLs.