diff --git a/src/sentry/interfaces/http.py b/src/sentry/interfaces/http.py index 73a2c02a6675f2..9547cdcfdc3fee 100644 --- a/src/sentry/interfaces/http.py +++ b/src/sentry/interfaces/http.py @@ -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: @@ -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)) diff --git a/tests/sentry/interfaces/test_http.py b/tests/sentry/interfaces/test_http.py index 16a76315734f4d..a0666bcc7b98f4 100644 --- a/tests/sentry/interfaces/test_http.py +++ b/tests/sentry/interfaces/test_http.py @@ -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(