You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Okay, I see that the matcher for the protocol will optionally match any a-z string followed by :, and then //. I guess I assumed from the docs that a valid protocol was one that was also known (which I realize isn't well-defined in itself). Maybe the answer to this is to just clarify what the definition of a valid protocol is in the docs. I could also see an option to only match a certain set of well-known or user-provided protocols being a solution too.
Describe the bug
Node.js version: v18.18.2
OS version: macOS 14.2.1
Description: If a valid protocol has extra characters preceding it, the extra characters are included in the match.
Actual behavior
urlRegexSafe({ strict: true }).exec("gaewggwhttp://localhost:3000/derp")
Produces a match that contains the entire string, including "gaewgg".
This also happens when strict is set to false.
Expected behavior
The match that is produced does not include "gaewgg"
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: