http_static: a prefix with a trailing slash matches no file, and nothing says so

Open Beginner friendly
#2,356 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c
Domain
backend

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

area:http kind:bug

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_static with 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.md says 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

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InauguralSystems/EigenScript

All issues in InauguralSystems/EigenScript

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.