diff options
| author | Éric Araujo <merwok@netwok.org> | 2020-05-06 09:57:21 -0400 |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2020-05-06 09:57:21 -0400 |
| commit | c60c98b5169023f8e7f19eb841a0c72230fa6c30 (patch) | |
| tree | 5d6bfe3926259eb62c241f90d57232fd990a086f /src | |
| parent | c65d2c03174d5a2d66a7a85974b938070ad01a71 (diff) | |
| download | pyramid-c60c98b5169023f8e7f19eb841a0c72230fa6c30.tar.gz pyramid-c60c98b5169023f8e7f19eb841a0c72230fa6c30.tar.bz2 pyramid-c60c98b5169023f8e7f19eb841a0c72230fa6c30.zip | |
more rewording
Diffstat (limited to 'src')
| -rw-r--r-- | src/pyramid/config/routes.py | 36 | ||||
| -rw-r--r-- | src/pyramid/config/views.py | 36 |
2 files changed, 34 insertions, 38 deletions
diff --git a/src/pyramid/config/routes.py b/src/pyramid/config/routes.py index 7208f5adb..41c7108df 100644 --- a/src/pyramid/config/routes.py +++ b/src/pyramid/config/routes.py @@ -220,25 +220,23 @@ class RoutesConfiguratorMixin: header This value can be a string or an iterable of strings for HTTP - header names. Any string that does not contain a ``:`` - (colon) will be considered to be the header name (e.g. - ``If-Modified-Since``). In this case, the header specified by - the name must be present in the request for this predicate - to be true. - - If a string contains a colon, it will be considered a - name/value pair (e.g. ``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. - - Whether or not the strings - represent a header name or a header name/value pair, the - case of the header name is not significant. If this - predicate returns ``False``, route matching continues. - When the value is an iterable of strings, they must all - return ``True`` for this predicate to return ``True``. + header names. The header names are 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``). + 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 + ``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. + + All strings must be matched for this predicate to return ``True``. + If this predicate returns ``False``, route matching continues. accept diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py index cf1b0a800..ebef7840d 100644 --- a/src/pyramid/config/views.py +++ b/src/pyramid/config/views.py @@ -671,25 +671,23 @@ class ViewsConfiguratorMixin: header This value can be a string or an iterable of strings for HTTP - header names. Any string that does not contain a ``:`` - (colon) will be considered to be the header name (e.g. - ``If-Modified-Since``). In this case, the header specified by - the name must be present in the request for this predicate - to be true. - - If a string contains a colon, it will be considered a - name/value pair (e.g. ``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. - - Whether or not the strings - represent a header name or a header name/value pair, the - case of the header name is not significant. If this - predicate returns ``False``, route matching continues. - When the value is an iterable of strings, they must all - return ``True`` for this predicate to return ``True``. + header names. The header names are 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``). + 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 + ``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. + + All strings must be matched for this predicate to return ``True``. + If this predicate returns ``False``, view matching continues. path_info |
