Skip to content

fix: Default basePath to / when server URL has no path#74

Merged
thced merged 2 commits into
masterfrom
fix/loopback
May 20, 2026
Merged

fix: Default basePath to / when server URL has no path#74
thced merged 2 commits into
masterfrom
fix/loopback

Conversation

@thced

@thced thced commented May 20, 2026

Copy link
Copy Markdown
Contributor

URI.create("http://127.0.0.1:4444").getPath() returns an empty string, not null, so the previous Optional.ofNullable fallback left basePath empty and HttpServer.createContext rejected it.

thced added 2 commits May 20, 2026 13:02
URI.create("http://127.0.0.1:4444").getPath() returns an empty
string, not null, so the previous Optional.ofNullable fallback
left basePath empty and HttpServer.createContext rejected it.
The catch-all 404 context at / collided with the spec context when
the server URL had no path. Skip the catch-all in that case.
@sonarqubecloud

Copy link
Copy Markdown

@thced thced merged commit f24ea84 into master May 20, 2026
5 checks passed
@thced thced deleted the fix/loopback branch May 20, 2026 11:11
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.

1 participant