Skip to content
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

Add RFC 7231 Validation Indicator #6

Open
patrickdark opened this issue Apr 22, 2017 · 0 comments
Open

Add RFC 7231 Validation Indicator #6

patrickdark opened this issue Apr 22, 2017 · 0 comments

Comments

@patrickdark
Copy link

patrickdark commented Apr 22, 2017

This one is just a feature request: you could add some indicator showing whether a value is valid per RFC 7231 using a regular expression:

/^[a-z]{1,8}(?:-[a-z]{1,8})?(?:;q=(?:0(?:\.\d{0,3})?|1(?:\.0{0,3})?))?(?:, *[a-z]{1,8}(?:-[a-z]{1,8})?(?:;q=(?:0(?:\.\d{0,3})?|1(?:\.0{0,3})?))?)*$/i

It's very easy to accidentally put a space between the ";q" or assume that something like "en-latn-usa"—which is valid in HTML lang and XML xml:lang attributes—is valid, for example. This would catch those errors.

RFC 7231 §5.3.5: https://tools.ietf.org/html/rfc7231#section-5.3.5

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

No branches or pull requests

1 participant