diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/pyramid/config/routes.py | 16 | ||||
| -rw-r--r-- | src/pyramid/config/views.py | 12 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/pyramid/config/routes.py b/src/pyramid/config/routes.py index 4896ce0ea..a12e18fa8 100644 --- a/src/pyramid/config/routes.py +++ b/src/pyramid/config/routes.py @@ -211,29 +211,29 @@ class RoutesConfiguratorMixin: dictionary (an HTTP ``GET`` or ``POST`` variable) that has a name which matches the supplied value. If the value supplied as the argument has a ``=`` sign in it, - e.g. ``request_param="foo=123"``, then the key - (``foo``) must both exist in the ``request.params`` dictionary, and + e.g. ``request_param="foo=123"``, then both the key + (``foo``) must exist in the ``request.params`` dictionary, and the value must match the right hand side of the expression (``123``) for the route to "match" the current request. If this predicate returns ``False``, route matching continues. header - This value can be a string or an iterable of strings for HTTP - header names. The header names are determined as follow: + This argument can be a string or an iterable of strings for HTTP + headers. The matching is determined as follow: - If a string does not contain a ``:`` (colon), it will be - considered to be the header name (e.g. ``If-Modified-Since``). + considered to be the header name (example ``If-Modified-Since``). In this case, the header specified by the name must be present in the request for this string to match. Case is not significant. - If a string contains a colon, it will be considered a - name/value pair (e.g. ``User-Agent:Mozilla/.*`` or + name/value pair (for example ``User-Agent:Mozilla/.*`` or ``Host:localhost``), where the value part is a regular expression. The header specified by the name must be present in the request *and* the regular expression specified as the - value must match the header value. Case is not significant for - the header name, but it is for the value. + value part must match the value of the request header. Case is + not significant for the header name, but it is for the value. All strings must be matched for this predicate to return ``True``. If this predicate returns ``False``, route matching continues. diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py index 170f8a028..a064ebd05 100644 --- a/src/pyramid/config/views.py +++ b/src/pyramid/config/views.py @@ -670,21 +670,21 @@ class ViewsConfiguratorMixin: header - This value can be a string or an iterable of strings for HTTP - header names. The header names are determined as follow: + This argument can be a string or an iterable of strings for HTTP + headers. The matching is determined as follow: - If a string does not contain a ``:`` (colon), it will be - considered to be the header name (e.g. ``If-Modified-Since``). + considered to be a header name (example ``If-Modified-Since``). In this case, the header specified by the name must be present in the request for this string to match. Case is not significant. - If a string contains a colon, it will be considered a - name/value pair (e.g. ``User-Agent:Mozilla/.*`` or + name/value pair (for example ``User-Agent:Mozilla/.*`` or ``Host:localhost``), where the value part is a regular expression. The header specified by the name must be present in the request *and* the regular expression specified as the - value must match the header value. Case is not significant for - the header name, but it is for the value. + value part must match the value of the request header. Case is + not significant for the header name, but it is for the value. All strings must be matched for this predicate to return ``True``. If this predicate returns ``False``, view matching continues. |
