Skip to content

Commit

Permalink
fix(uri): update bugfix message
Browse files Browse the repository at this point in the history
update bugfix message to explain change.
remove unnecessary comment.

closes falconry#1872
  • Loading branch information
MinesJA committed Mar 15, 2021
1 parent 32aea68 commit c4a484f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 5 additions & 2 deletions docs/_newsfragments/1872.bugfix.rst
@@ -1,4 +1,7 @@
:attr:`falcon.Uri.encode` and :attr:`falcon.Uri.encode_value` now escape all
percent characters by default even if it appears they have already been escaped.
The ``check_is_escaped`` flag has been added to allow the option of retaining the previous
behavior of ignoring strings that look like they've already been escaped.
The :attr:`falcon.Uri.encode_check_escaped` and :attr:`falcon.Uri.encode_value_check_escaped`
methods have been added to give the option of retaining the previous behavior where needed.
These new methods have been applied to the :attr:`falcon.Response.location`,
:attr:`falcon.Response.content_location`, :attr:`falcon.Response.append_link`
attrs and methods to retain previous behavior.
2 changes: 1 addition & 1 deletion falcon/util/uri.py
Expand Up @@ -553,5 +553,5 @@ def unquote_string(quoted):
'encode_value_check_escaped',
'parse_host',
'parse_query_string',
'unquote_string'
'unquote_string',
]
3 changes: 0 additions & 3 deletions tests/test_utils.py
Expand Up @@ -244,9 +244,6 @@ def test_uri_encode(self):
assert uri.decode(uri.encode('%26')) == '%26'

def test_uri_encode_double(self):
# NOTE(minesja): check_is_escaped added to allow option to
# retain behavior of ignoring already escaped values (#68)

url = 'http://example.com/v1/fiz bit/messages'
expected = 'http://example.com/v1/fiz%20bit/messages'
assert uri.encode_check_escaped(uri.encode_check_escaped(url)) == expected
Expand Down

0 comments on commit c4a484f

Please sign in to comment.