Skip to content

feat: add Nack::URLMap - #81

Merged
himura467 merged 1 commit into
mainfrom
feat-urlmap
Nov 10, 2026
Merged

himura467 merged 1 commit into
mainfrom
feat-urlmap

Conversation

@himura467

Copy link
Copy Markdown
Contributor

Closes #20

  • Adds Nack::URLMap, built from a Hash of references to apps. A reference is an absolute-path reference (/path) or a network-path reference (//host/path); one without a leading slash, with an empty host, or with a port raises ArgumentError.
  • call moves the matched prefix from path_info to script_name, calls the app, and restores both on the way out, also when the app raises.
  • A prefix matches at a segment boundary, so /a matches /a and /a/b but not /ab. A mount for the request's host wins, and among the rest the longest prefix wins. Hosts compare case-insensitively and ignore the request's port.
  • A request whose path is nil (authority-form CONNECT) or * (asterisk-form OPTIONS) matches no prefix. Anything unmatched gets a 404.
  • Paths are compared as received, without percent-decoding or dot-segment removal.

@himura467
himura467 merged commit 0dc94a3 into main Nov 10, 2026
4 checks passed
@himura467
himura467 deleted the feat-urlmap branch November 10, 2026 08:37
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.

Add Nack::URLMap

1 participant