-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structured header parameter parser is too loose #454
Comments
Yeah, there should be a lint rule for this. (I prefer a lint rule to outright rejecting these inputs because it's nicer to get some output while iterating.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A parameter name missing leading and/or trailing
_
is accepted, probably erroneously. For example,_modifiers: a Modifiers,
(as currently in proposal-regexp-modifiers spec) renders like "_modifiers (a Modifiers)" with the literal_
visible and "modifiers" not wrapped in a<var>
element (as currently in proposal-regexp-modifiers HTML).The responsible code appears to be at
ecmarkup/src/header-parser.ts
Line 140 in 994d663
/^[A-Za-z0-9_] */i
should probably be replaced with/^_[A-Za-z0-9] _ */i
, or maybe/^(?:_[A-Za-z0-9] _|[A-Za-z0-9] ) */i
if we want to support parameter names not wrapped in_
(which I'd personally be against). And incidentally, I also note that thei
flag is redundant withA-Za-z
.The text was updated successfully, but these errors were encountered: