Skip to content

Commit

Permalink
Refactoring JwtEncoder (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
abatishchev authored Jun 24, 2019
1 parent 2fd681e commit 050b24b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/JWT/JwtEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public string Encode(IDictionary<string, object> extraHeaders, object payload, b

var segments = new List<string>(3);

var header = extraHeaders != null ? new Dictionary<string, object>(extraHeaders) : new Dictionary<string, object>();
var header = extraHeaders is null ? new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase) : extraHeaders;
header.Add("typ", "JWT");
header.Add("alg", _algorithm.Name);

Expand All @@ -68,4 +68,4 @@ public string Encode(IDictionary<string, object> extraHeaders, object payload, b
return String.Join(".", segments.ToArray());
}
}
}
}

0 comments on commit 050b24b

Please sign in to comment.