Skip to content

fix: accept the Host header browsers send on port 80 - #13

Merged
VikramLex merged 1 commit into
Graphicle-AI:mainfrom
rudycelekli:fix/serve-default-port-host
Oct 26, 2026
Merged

VikramLex merged 1 commit into
Graphicle-AI:mainfrom
rudycelekli:fix/serve-default-port-host

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

Summary

  • graphicle serve --port 80 allowed only 127.0.0.1:80 and localhost:80.
  • Browsers and curl omit the default HTTP port, so Host: 127.0.0.1, Host: localhost, and Host: [::1] were refused. Port 80 now accepts those bare hosts. Other ports stay port-qualified.

Test plan

  • On current main behavior, the host allowlist for 127.0.0.1:80 is only 127.0.0.1:80 and localhost:80, so the bare-host assertions fail.
  • After this change, cargo test --lib -- the_default_http_port_allows_the_host_header_without_a_port passes for IPv4, IPv6, and the usual port 8854.
  • graphicle serve --port 80 accepts curl http://127.0.0.1/ and curl http://localhost/.

Made with Cursor

graphicle serve --port 80 allowed only 127.0.0.1:80 and localhost:80.
HTTP clients omit the default port, so a browser or curl sent 127.0.0.1
or localhost and every request was refused as an unexpected host.

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
@VikramLex
VikramLex merged commit 8750f39 into Graphicle-AI:main Oct 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants