Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sentry/interfaces/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def to_python(cls, data):
# three dots (which is the behavior of other SDKs). This effectively
# makes the string two characters longer, but it will be trimmed
# again down below.
if url.endswith("\u2026"):
if url.endswith(u"\u2026"):
url = url[:-1] + "..."
scheme, netloc, path, query_bit, fragment_bit = urlsplit(url)
else:
Expand All @@ -159,7 +159,7 @@ def to_python(cls, data):
if isinstance(query_string, six.string_types):
if query_string[0] == '?':
query_string = query_string[1:]
if query_string.endswith("\u2026"):
if query_string.endswith(u"\u2026"):
query_string = query_string[:-1] + "..."
query_string = [
(to_unicode(k), jsonify(v))
Expand Down
8 changes: 4 additions & 4 deletions tests/sentry/interfaces/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,19 @@ def test_query_string_and_fragment_as_params(self):
result = Http.to_python(
dict(
url='http://example.com',
query_string='foo=bar',
query_string=u'foo=bar\u2026',
fragment='fragment',
)
)
assert result.url == 'http://example.com'
assert result.full_url == 'http://example.com?foo=bar#fragment'
assert result.full_url == 'http://example.com?foo=bar...#fragment'

def test_query_string_and_fragment_in_url(self):
result = Http.to_python(dict(
url='http://example.com?foo=bar#fragment',
url=u'http://example.com?foo=bar#fragment\u2026',
))
assert result.url == 'http://example.com'
assert result.full_url == 'http://example.com?foo=bar#fragment'
assert result.full_url == 'http://example.com?foo=bar#fragment...'

def test_header_value_list(self):
result = Http.to_python(dict(
Expand Down