http_static: a prefix with a trailing slash matches no file, and nothing says so
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
Research direction
Start with the route check in src/ext_http.c, where the byte after the registered prefix must be / or the end of the path. Reproduce with a single http_static of ["/s1/", "files"] registration and a GET to /s1/a.txt, which should return 404. Pick one of the two outcomes the issue allows, either matching the trailing-slash form or rejecting it at registration, and record the choice in docs/BUILTINS.md. Done means both spellings are covered by a test that starts a server and fetches a file.
Written by the indexing model from the issue text.
Description
Found by a consumer's HTTP server at 54008422.
What happens
http_static of [prefix, dir] serves the files of dir under prefix. A prefix written with a trailing slash matches no file. With files/a.txt present:
http_static of ["/s1/", "files"]
http_serve of 3000
GET /s1/a.txt answers 404 ({"error": "not_found"}). The same program with the prefix "/s1" answers 200. The route check in src/ext_http.c asks that the byte after the whole prefix be / or the end of the path, and after /s1/ the next byte is the file's first letter.
Why it matters
Both spellings are common, nothing is printed at registration, and the 404 is the same one an unknown path gets. A page that loads its script from such a prefix simply has no script.
Done when
http_staticwith a trailing slash on the prefix serves the same files as without it, or refuses the prefix at registration with an error that names it.docs/BUILTINS.mdsays which form the prefix takes.- A test starts one server for each spelling and fetches a file under it.
Corrected 2026-11-12. The first text of this issue registered both spellings in one program and read the 404 for /s1/ there. That program cannot show it: a second http_static replaces the first (#2357), so /s1/ would have answered 404 with or without its slash. The single registration above was run afterwards and answers 404 as described.
- Dominant language
- C
- Stars
- 3
- Forks
- 7
- Avg merge
- 3h 30m
- Merged PRs (30d)
- 264
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from InauguralSystems/EigenScript
-
http_fetch tests: the two no-child rows fail, not skip, where a task's children file does not existPossibly taken A pull request linked to this issue is open or already merged. Openarea:http kind:gate-defect
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
InauguralSystems/EigenScript#2397 ·
Maintainers usually reply within 1 day
-
`http_post`: `headers` text with something after its JSON value now means no headers, without a wordOpenarea:http kind:silent-wrong
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
InauguralSystems/EigenScript#2394 · 1 comment ·
Maintainers usually reply within 1 day
-
area:docs good first issue kind:docs-drift
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
InauguralSystems/EigenScript#2360 ·
Maintainers usually reply within 1 day
-
area:stdlib kind:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
InauguralSystems/EigenScript#2355 · 2 comments ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 82/100
InauguralSystems/EigenScript#2335 · 1 comment ·
Maintainers usually reply within 1 day
All issues in InauguralSystems/EigenScript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
openziti/ziti-sdk-c#1254 ·
Maintainers usually reply within 1 day
-
Add SECURITY.mdOpenenhancement
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
modem: ppp: CMUX DLCI receive buffer overruns on large downlink packetsPossibly taken @pedrohqr claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
zephyrproject-rtos/zephyr#126195 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
ly05010419/MacNativeGames#2271 ·
Maintainers usually reply within 1 day