Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit3fc4eee

Browse 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 paramThis replaces#7973.Commits-------fb9d377 Added a note about using slashes and the special _format param
2 parents2a215c4 +fb9d377 commit3fc4eee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎routing/slash_in_parameter.rst‎

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp