diff options
| author | Casey Duncan <casey.duncan@gmail.com> | 2010-11-22 17:55:49 -0700 |
|---|---|---|
| committer | Casey Duncan <casey.duncan@gmail.com> | 2010-11-22 17:55:49 -0700 |
| commit | 88372f02187ed5f8038379c54fa05e32cfe9560a (patch) | |
| tree | e381c82bda65f821d7840796d37ca802f47f7055 /docs | |
| parent | b890a2026f467e3470cb1fa316317883e96d605e (diff) | |
| download | pyramid-88372f02187ed5f8038379c54fa05e32cfe9560a.tar.gz pyramid-88372f02187ed5f8038379c54fa05e32cfe9560a.tar.bz2 pyramid-88372f02187ed5f8038379c54fa05e32cfe9560a.zip | |
Be consistent with the spelling of 'slash-appending not found view', Change paragraph about losing POST data on redirect to a warning
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/urldispatch.rst | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index 3483c8b9f..253dd7f0e 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -1092,20 +1092,24 @@ your route configuration looks like so: config.add_route('noslash', 'no_slash', view='myproject.views.no_slash') config.add_route('hasslash', 'has_slash/', view='myproject.views.has_slash') -If a request enters the application with the ``PATH_INFO`` value of +If a request enters the application with the ``PATH_INFO`` +value of ``/has_slash/``, the second route will match. If a request +enters the application with the ``PATH_INFO`` value of ``/has_slash``, +a route *will* be found by the slash-appending not found view. An HTTP +redirect to ``/has_slash/`` will be returned to the user's browser. + +However, if a request enters the application with the ``PATH_INFO`` value of ``/no_slash``, the first route will match. If a request enters the application with the ``PATH_INFO`` value of ``/no_slash/``, *no* route -will match, and the slash-appending "not found" view will *not* find a +will match, and the slash-appending not found view will *not* find a matching route with an appended slash. -However, if a request enters the application with the ``PATH_INFO`` -value of ``/has_slash/``, the second route will match. If a request -enters the application with the ``PATH_INFO`` value of ``/has_slash``, -a route *will* be found by the slash appending notfound view. An HTTP -redirect to ``/has_slash/`` will be returned to the user's browser. +.. warning:: -Note that this will *lose* ``POST`` data information (turning it into -a GET), so you shouldn't rely on this to redirect POST requests. + You **should not** rely on this mechanism to redirect ``POST`` requests. + The redirect of the slash-appending not found view will turn a ``POST`` + request into a ``GET``, losing any ``POST`` data in the original + request. To configure the slash-appending not found view in your application, change the application's startup configuration, adding the following stanza: |
