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 Jan 19, 2019
1 parent 5b97a04 commit dbd4ff4
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 @@ -452,6 +452,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 @@ -468,7 +469,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 @@ -481,7 +482,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 @@ -495,7 +496,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 @@ -513,7 +514,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 @@ -524,16 +525,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 @@ -566,6 +566,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 @@ -590,7 +591,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 @@ -628,7 +629,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 @@ -955,7 +956,7 @@ def _wsgi_headers(self, media_type=None, py2=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 dbd4ff4

Please sign in to comment.