From c60c98b5169023f8e7f19eb841a0c72230fa6c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Wed, 6 May 2020 09:57:21 -0400 Subject: more rewording --- src/pyramid/config/routes.py | 36 +++++++++++++++++------------------- src/pyramid/config/views.py | 36 +++++++++++++++++------------------- 2 files changed, 34 insertions(+), 38 deletions(-) (limited to 'src') 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 -- cgit v1.2.3