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

docs: greedy labels in URI patterns match greedily #965

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/source/1.0/spec/core/http-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ Greedy matching can be used to capture the whole URI to a label, which results
in every request for a particular HTTP method being captured. For example, this
can be modeled with a pattern of ``/{label+}``.

Segments in the middle of a URI can be captured using greedy labels. Given a
Segments in the middle of a URI can be captured using greedy labels. Greedy
labels match greedily: they will match the longest possible string. Given a
pattern of ``/prefix/{label+}/suffix`` and an endpoint of ``https://yourhost``:

.. list-table::
Expand All @@ -403,6 +404,10 @@ pattern of ``/prefix/{label+}/suffix`` and an endpoint of ``https://yourhost``:
* - ``http://yourhost/foo/bar/suffix``
- No
- Does not match the literal "/prefix".
* - ``http://yourhost/prefix/foo/suffix/bar/suffix``
- Yes
- Matches literal "/prefix", captures "foo/suffix/bar" in greedy
``label``, and matches literal "/suffix".


Pattern Validation and Conflict Avoidance
Expand Down