Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3fc4eee

Browse filesBrowse files
committed
minor #9165 Added a note about using slashes and the special _format param (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Added a note about using slashes and the special _format param This replaces #7973. Commits ------- fb9d377 Added a note about using slashes and the special _format param
2 parents 2a215c4 + fb9d377 commit 3fc4eee
Copy full SHA for 3fc4eee

File tree

1 file changed

+9
-0
lines changed
Filter options

1 file changed

+9
-0
lines changed

‎routing/slash_in_parameter.rst

Copy file name to clipboardExpand all lines: routing/slash_in_parameter.rst
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ a more permissive regular expression for it:
7777
7878
That's it! Now, the ``{token}`` parameter can contain the ``/`` character.
7979

80+
.. note::
81+
82+
If the route includes the special ``{_format}`` placeholder, you shouldn't
83+
use the ``.+`` requirement for the parameters that allow slashes. For example,
84+
if the pattern is ``/share/{token}.{_format}`` and ``{token}`` allows any
85+
character, the ``/share/foo/bar.json`` URL will consider ``foo/bar.json``
86+
as the token and the format will be empty. This can be solved replacing the
87+
``.+`` requirement by ``[^.]+`` to allow any character except dots.
88+
8089
.. note::
8190

8291
If the route defines several placeholders and you apply this permissive

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.