doc: clarify PathPrefix greediness
This commit is contained in:
parent
f6b7940b76
commit
af4e74c39d
1 changed files with 3 additions and 2 deletions
|
@ -276,10 +276,11 @@ The table below lists all the available matchers:
|
||||||
|
|
||||||
!!! info "Path Vs PathPrefix"
|
!!! info "Path Vs PathPrefix"
|
||||||
|
|
||||||
Use `Path` if your service listens on the exact path only. For instance, `Path: /products` would match `/products` but not `/products/shoes`.
|
Use `Path` if your service listens on the exact path only. For instance, ```Path(`/products`)``` would match `/products` but not `/products/shoes`.
|
||||||
|
|
||||||
Use a `*Prefix*` matcher if your service listens on a particular base path but also serves requests on sub-paths.
|
Use a `*Prefix*` matcher if your service listens on a particular base path but also serves requests on sub-paths.
|
||||||
For instance, `PathPrefix: /products` would match `/products` but also `/products/shoes` and `/products/shirts`.
|
For instance, ```PathPrefix(`/products`)``` would match `/products` and `/products/shoes`,
|
||||||
|
as well as `/productsforsale`, and `/productsforsale/shoes`.
|
||||||
Since the path is forwarded as-is, your service is expected to listen on `/products`.
|
Since the path is forwarded as-is, your service is expected to listen on `/products`.
|
||||||
|
|
||||||
!!! info "ClientIP matcher"
|
!!! info "ClientIP matcher"
|
||||||
|
|
Loading…
Reference in a new issue