Skip to content

Commit

Permalink
feat(router) support for URIs as user-specified regexes
Browse files Browse the repository at this point in the history
When a value from an API's `uris` property does not respect the reserved
character set from RFC 3986, the router now assumes this value is a
user-specified regex.

User regexes are stored in another index than what we consider "URI
prefixes" (non-regex `uris` values), because while the later needs to be
evaluated based on their length, the same does not apply for the former.
The order in which regexes are specified (and ultimately, APIs are
registered) will be the order in which they will be evaluated.

Because users might specify their own capturing groups once we support
parameters extraction, the URI stripping now uses named capturing
groups. This requires PCRE 7.2+. The original implementation used
numbered capturing groups, but this is not aligned with our long-term
goal of allowing dynamic URI rewriting as part of our Plugins API or
request-transformer plugin.

Breaking changes: requires PCRE 7.2+

Implements: #677 (partially)
  • Loading branch information
thibaultcha committed Jul 11, 2017
1 parent 37578b1 commit 3c9df72
Show file tree
Hide file tree
Showing 2 changed files with 304 additions and 165 deletions.
Loading

0 comments on commit 3c9df72

Please sign in to comment.