Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/159'
Browse files Browse the repository at this point in the history
Fixes the Auth-Param header to remove bad white space in accordance with
RFC7235.

Closes #159
  • Loading branch information
digitalresistor committed Apr 4, 2015
2 parents 5ba5521 + 92e3595 commit 830e44e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/test_descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,10 @@ def test_parse_auth_params_truncate_on_comma():
def test_parse_auth_params_emptystr():
from webob.descriptors import parse_auth_params
eq_(parse_auth_params(''), {})

def test_parse_auth_params_bad_whitespace():
from webob.descriptors import parse_auth_params
eq_(parse_auth_params('a= "2 ", b =3, c=4 '), {'a': '2 ', 'b': '3', 'c': '4'})

def test_authorization2():
from webob.descriptors import parse_auth_params
Expand Down
2 changes: 1 addition & 1 deletion webob/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def serialize_content_range(value):



_rx_auth_param = re.compile(r'([a-z]+)=(".*?"|[^,]*)(?:\Z|, *)')
_rx_auth_param = re.compile(r'([a-z]+)[ \t]*=[ \t]*(".*?"|[^,]*?)[ \t]*(?:\Z|, *)')

def parse_auth_params(params):
r = {}
Expand Down

0 comments on commit 830e44e

Please sign in to comment.