This PR adds detailed validation of the value_format field to the compatibility table validator script, and also allows detection of invalid regular expressions
I installed the xregexp package, because as far as I know, the plain JS regex doesn't support free-space mode, which is the easiest way to handle regexps represented in YML in multiple lines + we can write comments inside the regexps like this:
adg_os_any:
name: removeheader
# Enable free-spacing and case-insensitive mode for the regex
value_format: |-
(?xi)
^
# Value may start with "request:"
(request:)?
# Forbidden header names
(?!
(
access-control-allow-origin|
access-control-allow-credentials|
access-control-allow-headers|
# ...
)
$)
# Any other header name is allowed, if it matches the following regex
[A-z0-9-]+
$
inverse_conflicts: true
This PR adds detailed validation of the
value_format
field to the compatibility table validator script, and also allows detection of invalid regular expressionsI installed the xregexp package, because as far as I know, the plain JS regex doesn't support free-space mode, which is the easiest way to handle regexps represented in YML in multiple lines + we can write comments inside the regexps like this: