Skip to content

Commit

Permalink
Revert "Fix Trace ID environment variable"
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleknap authored Jul 30, 2022
1 parent c61e661 commit 32f49ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion botocore/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def handle_service_name_alias(service_name, **kwargs):

def add_recursion_detection_header(params, **kwargs):
has_lambda_name = 'AWS_LAMBDA_FUNCTION_NAME' in os.environ
trace_id = os.environ.get('_X_AMZN_TRACE_ID')
trace_id = os.environ.get('_X_AMZ_TRACE_ID')
if has_lambda_name and trace_id:
headers = params['headers']
if 'X-Amzn-Trace-Id' not in headers:
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,21 +1520,21 @@ def test_does_validate_host_with_illegal_char(self):
'environ, header_before, header_after',
[
({'AWS_LAMBDA_FUNCTION_NAME': 'foo'}, {}, {}),
({'_X_AMZN_TRACE_ID': 'bar'}, {}, {}),
({'_X_AMZ_TRACE_ID': 'bar'}, {}, {}),
(
{'AWS_LAMBDA_FUNCTION_NAME': 'foo', '_X_AMZN_TRACE_ID': 'bar'},
{'AWS_LAMBDA_FUNCTION_NAME': 'foo', '_X_AMZ_TRACE_ID': 'bar'},
{},
{'X-Amzn-Trace-Id': 'bar'},
),
(
{'AWS_LAMBDA_FUNCTION_NAME': 'foo', '_X_AMZN_TRACE_ID': 'bar'},
{'AWS_LAMBDA_FUNCTION_NAME': 'foo', '_X_AMZ_TRACE_ID': 'bar'},
{'X-Amzn-Trace-Id': 'fizz'},
{'X-Amzn-Trace-Id': 'fizz'},
),
(
{
'AWS_LAMBDA_FUNCTION_NAME': 'foo',
'_X_AMZN_TRACE_ID': 'first\nsecond',
'_X_AMZ_TRACE_ID': 'first\nsecond',
},
{},
{'X-Amzn-Trace-Id': 'first%0Asecond'},
Expand Down

0 comments on commit 32f49ef

Please sign in to comment.