wombat icon indicating copy to clipboard operation
wombat copied to clipboard

Support for Case Insensitive Schemes

Open mijho opened this issue 11 months ago • 1 comments

We've come across some sites where the scheme's are capitalised, as wombat expects these to be lower cased they are not re-written.

I'm happy to put in a PR for this but before doing the work thought I should ask whether you'd want wombat to handle scheme's case insensitively first?

From RFC 3986:

Scheme names consist of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus ("+"), period ("."), or hyphen ("-"). Although schemes are case- insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. An implementation should accept uppercase letters as equivalent to lowercase in scheme names (e.g., allow "HTTP" as well as "http") for the sake of robustness but should only produce lowercase scheme names for consistency.

If you'd like support for this would you prefer for it to be added via a regex patten match or via explicitly adding the additional options?

https://github.com/webrecorder/wombat/blob/20596ca1e66928cae6f309af781f961aa112ca7f/src/wombat.js#L36

mijho avatar Nov 18 '24 09:11 mijho