Skip to content

Commit a5da392

Browse files
thehesiodhaotianw465
authored andcommitted
py2 fixes for httplib patch (#23)
* py2 fixes
1 parent 0a9ce14 commit a5da392

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

aws_xray_sdk/ext/httplib/patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def http_response_processor(wrapped, instance, args, kwargs, return_value,
2828
subsegment.put_http_meta(http.URL, xray_data.url)
2929

3030
if return_value:
31-
subsegment.put_http_meta(http.STATUS, return_value.code)
31+
subsegment.put_http_meta(http.STATUS, return_value.status)
3232

3333
# propagate to response object
3434
xray_data = _XRay_Data('READ', xray_data.host, xray_data.url)
@@ -65,7 +65,7 @@ def http_request_processor(wrapped, instance, args, kwargs, return_value,
6565

6666

6767
def _prep_request(wrapped, instance, args, kwargs):
68-
def decompose_args(method, url, body, headers, encode_chunked):
68+
def decompose_args(method, url, body, headers, encode_chunked=False):
6969
inject_trace_header(headers, xray_recorder.current_subsegment())
7070

7171
# we have to check against sock because urllib3's HTTPSConnection inherit's from http.client.HTTPConnection

aws_xray_sdk/ext/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def to_snake_case(name):
9292

9393

9494
# ? is not a valid entity, and we don't want things after the ? for the segment name
95-
def strip_url(url: str):
95+
def strip_url(url):
9696
"""
9797
Will generate a valid url string for use as a segment name
9898
:param url: url to strip

0 commit comments

Comments
 (0)