Skip to content

Commit

Permalink
doc(response): Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
kgriffs committed Feb 9, 2019
1 parent eb337e3 commit 4a3cef7
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions falcon/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ def get_header(self, name, default=None):
the default value if not set.
"""

# NOTE(kgriffs): normalize name by lowercasing it
name = name.lower()

if name == 'set-cookie':
Expand All @@ -472,7 +473,7 @@ def set_header(self, name, value):
:meth:`~.append_header` instead.
Warning:
This method can not be used to set cookies; instead, use
This method cannot be used to set cookies; instead, use
:meth:`~.append_header` or :meth:`~.set_cookie`.
Args:
Expand All @@ -485,7 +486,7 @@ def set_header(self, name, value):
although such strings are also limited to US-ASCII.
Raises:
ValueError: `name` can not be ``'Set-Cookie'``.
ValueError: `name` cannot be ``'Set-Cookie'``.
"""

# NOTE(kgriffs): uwsgi fails with a TypeError if any header
Expand All @@ -499,7 +500,7 @@ def set_header(self, name, value):
name = name.lower()

if name == 'set-cookie':
raise HeaderNotSupported('This method can not be used to set cookies')
raise HeaderNotSupported('This method cannot be used to set cookies')

self._headers[name] = value

Expand All @@ -517,7 +518,7 @@ def delete_header(self, name):
resp.etag = None
Warning:
This method can not be used with the Set-Cookie header. Instead,
This method cannot be used with the Set-Cookie header. Instead,
use :meth:`~.unset_cookie` to remove a cookie and ensure that the
user agent expires its own copy of the data as well.
Expand All @@ -528,16 +529,15 @@ def delete_header(self, name):
although such strings are also limited to US-ASCII.
Raises:
ValueError: `name` can not be ``'Set-Cookie'``.
ValueError: `name` cannot be ``'Set-Cookie'``.
"""

# NOTE(kgriffs): normalize name by lowercasing it
name = name.lower()

if name == 'set-cookie':
raise HeaderNotSupported('This method can not be used to remove cookies')
raise HeaderNotSupported('This method cannot be used to remove cookies')

# NOTE(kgriffs): normalize name by lowercasing it
self._headers.pop(name, None)

def append_header(self, name, value):
Expand Down Expand Up @@ -570,6 +570,7 @@ def append_header(self, name, value):
name = str(name)
value = str(value)

# NOTE(kgriffs): normalize name by lowercasing it
name = name.lower()

if name == 'set-cookie':
Expand All @@ -594,7 +595,7 @@ def set_headers(self, headers):
:meth:`~.append_header`.
Warning:
This method can not be used to set cookies; instead, use
This method cannot be used to set cookies; instead, use
:meth:`~.append_header` or :meth:`~.set_cookie`.
Args:
Expand Down Expand Up @@ -632,7 +633,7 @@ def set_headers(self, headers):
name = name.lower()

if name == 'set-cookie':
raise HeaderNotSupported('This method can not be used to set cookies')
raise HeaderNotSupported('This method cannot be used to set cookies')

_headers[name] = value

Expand Down Expand Up @@ -961,7 +962,7 @@ def _wsgi_headers(self, media_type=None, py2=compat.PY2):
items += self._extra_headers

# NOTE(kgriffs): It is important to append these after self._extra_headers
# in case the latter containes Set-Cookie headers that should be
# in case the latter contains Set-Cookie headers that should be
# overridden by a call to unset_cookie().
if self._cookies is not None:
# PERF(tbug):
Expand Down

0 comments on commit 4a3cef7

Please sign in to comment.