aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/guide/routing.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-14 16:42:46 +0100
committerLoïc Hoguin <[email protected]>2018-11-14 18:04:32 +0100
commitf0cae8dbcf8d07035be069860fc4b22f7577d154 (patch)
treeed5cbc2b8a39a7a385b4c17c77e6f8b39b3f6461 /doc/src/guide/routing.asciidoc
parentc65e3ff20e0cf64c574d98550c2a88527dde49ce (diff)
downloadcowboy-f0cae8dbcf8d07035be069860fc4b22f7577d154.tar.gz
cowboy-f0cae8dbcf8d07035be069860fc4b22f7577d154.tar.bz2
cowboy-f0cae8dbcf8d07035be069860fc4b22f7577d154.zip
Document some undefined behavior in cowboy_router
Diffstat (limited to 'doc/src/guide/routing.asciidoc')
-rw-r--r--doc/src/guide/routing.asciidoc8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/src/guide/routing.asciidoc b/doc/src/guide/routing.asciidoc
index 47ef3c5..e5f8c33 100644
--- a/doc/src/guide/routing.asciidoc
+++ b/doc/src/guide/routing.asciidoc
@@ -124,6 +124,14 @@ You can also have imbricated optional segments.
[source,erlang]
PathMatch = "/hats/[page/[:number]]".
+While Cowboy does not reject multiple brackets in a route,
+the behavior may be undefined if the route is under-specified.
+For example, this route requires constraints to determine what
+is a chapter and what is a page, since they are both optional:
+
+[source,erlang]
+PathMatch = "/book/[:chapter]/[:page]".
+
You can retrieve the rest of the host or path using `[...]`.
In the case of hosts it will match anything before, in the case
of paths anything after the previously matched segments. It is