@@ -28,7 +28,7 @@ module Plugins
28
28
'TraceId' => {
29
29
'shape' => 'String' ,
30
30
'location' => "header" ,
31
- 'locationName' => "x-amz -trace-id"
31
+ 'locationName' => "x-amzn -trace-id"
32
32
}
33
33
}
34
34
} ,
@@ -47,21 +47,21 @@ module Plugins
47
47
context 'no ENV variables set' do
48
48
it 'does not set the header when ENV is not set' do
49
49
resp = client . operation_with_trace_id
50
- expect ( resp . context . http_request . headers . key? ( 'x-amz -trace-id' ) ) . to be_falsey
50
+ expect ( resp . context . http_request . headers . key? ( 'x-amzn -trace-id' ) ) . to be_falsey
51
51
end
52
52
end
53
53
54
54
context 'AWS_LAMBDA_FUNCTION_NAME is not set' do
55
55
let ( :env_trace_id ) { 'Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;Sampled=1;lineage=a87bd80c:0,68fd508a:5,c512fbe3:2' }
56
56
before do
57
57
allow ( ENV ) . to receive ( :[] ) . and_return ( nil )
58
- allow ( ENV ) . to receive ( :[] ) . with ( '_X_AMZ_TRACE_ID ' )
58
+ allow ( ENV ) . to receive ( :[] ) . with ( '_X_AMZN_TRACE_ID ' )
59
59
. and_return ( env_trace_id )
60
60
end
61
61
62
62
it 'does not set the header' do
63
63
resp = client . operation_with_trace_id
64
- expect ( resp . context . http_request . headers . key? ( 'x-amz -trace-id' ) ) . to be_falsey
64
+ expect ( resp . context . http_request . headers . key? ( 'x-amzn -trace-id' ) ) . to be_falsey
65
65
66
66
end
67
67
@@ -73,19 +73,19 @@ module Plugins
73
73
allow ( ENV ) . to receive ( :[] ) . and_return ( nil )
74
74
allow ( ENV ) . to receive ( :[] ) . with ( 'AWS_LAMBDA_FUNCTION_NAME' )
75
75
. and_return ( lambda_function_name )
76
- allow ( ENV ) . to receive ( :[] ) . with ( '_X_AMZ_TRACE_ID ' )
76
+ allow ( ENV ) . to receive ( :[] ) . with ( '_X_AMZN_TRACE_ID ' )
77
77
. and_return ( env_trace_id )
78
78
end
79
79
80
80
it 'sets the header' do
81
81
resp = client . operation_with_trace_id
82
- expect ( resp . context . http_request . headers [ 'x-amz -trace-id' ] ) . to eq ( env_trace_id )
82
+ expect ( resp . context . http_request . headers [ 'x-amzn -trace-id' ] ) . to eq ( env_trace_id )
83
83
end
84
84
85
85
it 'does not override the header when the value is already set' do
86
86
user_trace_id = "user_trace_id"
87
87
resp = client . operation_with_trace_id ( trace_id : user_trace_id )
88
- expect ( resp . context . http_request . headers [ 'x-amz -trace-id' ] ) . to eq ( user_trace_id )
88
+ expect ( resp . context . http_request . headers [ 'x-amzn -trace-id' ] ) . to eq ( user_trace_id )
89
89
end
90
90
end
91
91
end
0 commit comments