Skip to content

Add RFC 7231 Validation Indicator #6

@patrickdark

Description

@patrickdark

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions