-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce more strict URL pathname validation
Use a regexp to enforce strict limits on pathname strings. The full pattern is: `^([-._~A-Za-z0-9/]|%[0-9a-fA-F][0-9a-fA-F])+$` Where the initial character class recognizes: - RFC 3986 non-reserved characters `[-._~A-Za-z0-9]` - RFC 3986 reserved path separator `/` understood by Hatrac And the disjoined patter handles: - Percent-encoded UTF-8 byte sequences `%[0-9a-fA-F][0-9a-fA-F]` A Bad Request error will be raised when clients attempt to use unsupported characters, to make diagnostics easier than if it merely raised Not Found. As a limited escape-hatch, add a top-level config field can override the initial character class of unquoted characters. This could be used to allow additional (out of spec) characters needed to support legacy use cases. This must be used with care. The config value cannot influence recognition of percent-encoded bytes.
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters