12
12
* express or implied. See the License for the specific language governing
13
13
* permissions and limitations under the License.
14
14
*/
15
+ using System ;
15
16
using System . Collections . Generic ;
16
17
using System . Linq ;
17
18
@@ -28,12 +29,14 @@ internal class RuntimeApiHeaders
28
29
29
30
public RuntimeApiHeaders ( Dictionary < string , IEnumerable < string > > headers )
30
31
{
31
- DeadlineMs = GetHeaderValueOrNull ( headers , HeaderDeadlineMs ) ;
32
- AwsRequestId = GetHeaderValueRequired ( headers , HeaderAwsRequestId ) ;
33
- ClientContextJson = GetHeaderValueOrNull ( headers , HeaderClientContext ) ;
34
- CognitoIdentityJson = GetHeaderValueOrNull ( headers , HeaderCognitoIdentity ) ;
35
- InvokedFunctionArn = GetHeaderValueOrNull ( headers , HeaderInvokedFunctionArn ) ;
36
- TraceId = GetHeaderValueOrNull ( headers , HeaderTraceId ) ;
32
+ var caseInsensitiveHeaders = new Dictionary < string , IEnumerable < string > > ( headers , StringComparer . OrdinalIgnoreCase ) ;
33
+
34
+ DeadlineMs = GetHeaderValueOrNull ( caseInsensitiveHeaders , HeaderDeadlineMs ) ;
35
+ AwsRequestId = GetHeaderValueRequired ( caseInsensitiveHeaders , HeaderAwsRequestId ) ;
36
+ ClientContextJson = GetHeaderValueOrNull ( caseInsensitiveHeaders , HeaderClientContext ) ;
37
+ CognitoIdentityJson = GetHeaderValueOrNull ( caseInsensitiveHeaders , HeaderCognitoIdentity ) ;
38
+ InvokedFunctionArn = GetHeaderValueOrNull ( caseInsensitiveHeaders , HeaderInvokedFunctionArn ) ;
39
+ TraceId = GetHeaderValueOrNull ( caseInsensitiveHeaders , HeaderTraceId ) ;
37
40
}
38
41
39
42
public string AwsRequestId { get ; private set ; }
@@ -58,5 +61,4 @@ private string GetHeaderValueOrNull(Dictionary<string, IEnumerable<string>> head
58
61
return null ;
59
62
}
60
63
}
61
-
62
64
}
0 commit comments