Fix ToHeaderDictionary in HttpSignature
This commit is contained in:
parent
6a80e503d9
commit
c207d77d51
1 changed files with 3 additions and 2 deletions
|
@ -11,7 +11,7 @@ public static class HttpSignature {
|
||||||
IEnumerable<string> requiredHeaders, string key) {
|
IEnumerable<string> requiredHeaders, string key) {
|
||||||
if (!requiredHeaders.All(signature.Headers.Contains))
|
if (!requiredHeaders.All(signature.Headers.Contains))
|
||||||
throw new ConstraintException("Request is missing required headers");
|
throw new ConstraintException("Request is missing required headers");
|
||||||
|
|
||||||
//TODO: verify date header exists and is set to something the last 12 hours
|
//TODO: verify date header exists and is set to something the last 12 hours
|
||||||
|
|
||||||
var signingString = GenerateSigningString(signature.Headers, request.Method,
|
var signingString = GenerateSigningString(signature.Headers, request.Method,
|
||||||
|
@ -86,7 +86,8 @@ public static class HttpSignature {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HeaderDictionary ToHeaderDictionary(this HttpRequestHeaders headers) {
|
private static HeaderDictionary ToHeaderDictionary(this HttpRequestHeaders headers) {
|
||||||
return new HeaderDictionary(headers.ToDictionary(p => p.Key, p => new StringValues(p.Value.ToArray())));
|
return new HeaderDictionary(headers.ToDictionary(p => p.Key.ToLowerInvariant(),
|
||||||
|
p => new StringValues(p.Value.ToArray())));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HttpSignatureHeader Parse(string header) {
|
public static HttpSignatureHeader Parse(string header) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue