Closed j-a-m-l closed 5 years ago
If you'd like to PR an update for this please feel free, otherwise I'll add support in the next week or two. I think ideally the regex would look like
/^vnd.[^\s\.]+\.v[0-9]+$/
Would this solve your needs?
Thanks for you answer.
That RegExp would be enough for me, although I'd use a different one, to adhere to the specification.
A different issue, that I've found when running the tests, is that some of them look incorrect:
For instance, this one shouldn't throw an Error: https://github.com/p-meier/hapi-api-version/blob/5c5b57fbaebaba8e6969aa0236a3cc1d30f7c297/test/index.js#L196
I'd like to contribute with the PR of the RegExp, but would you mind to confirm if those tests are correct?
The vendorField could follow the schema provided by the specification (https://tools.ietf.org/html/rfc6838#section-4.2), so the RegExp that extracts it from the
accept
header should be fixed to allow other characters than alphanumeric:https://github.com/p-meier/hapi-api-version/blob/5c5b57fbaebaba8e6969aa0236a3cc1d30f7c297/index.js#L37