Skip to content

Allow parentheses in validation for value strings#62

Open
roelnoort wants to merge 2 commits into
vercel:mainfrom
roelnoort:allow_parentheses
Open

Allow parentheses in validation for value strings#62
roelnoort wants to merge 2 commits into
vercel:mainfrom
roelnoort:allow_parentheses

Conversation

@roelnoort

Copy link
Copy Markdown

Hi,

I made this pull request to solve the issue in described in:
vercel/serve#649

In short:

  1. The serve library can be used to set up security headers.
  2. One new header, the Permissions-Policy has a changed syntax which is currently rejected because it fails the schema validation imposed by this repository.
  3. The schema validation does not allow parentheses () to be used. I added this by changing this regex pattern:
"^[a-zA-Z0-9_!#$%&'*+.;/:, =^`|~-]+$"

to this pattern:

"^[a-zA-Z0-9_!#$%&()'*+.;/:, =^`|~-]+$"

Also, I noticed that, after cloning and running npm install, I could not run npm test as yarn was not being installed. Therefore I added yarn as a development dependency to package.json.

Best, Roel

…xample in Content Security Policy headers which get validated by this pattern
@paulshryock

Copy link
Copy Markdown

Is anything blocking this from being merged?

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.

2 participants