Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

Commit

Permalink
Small change to make fetching of Authorization header value more robust.
Browse files Browse the repository at this point in the history
  • Loading branch information
naasir committed Jan 11, 2013
1 parent d531110 commit b84fe43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OAuth2Provider/Request/OAuthRequestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public string AccessToken
if (!string.IsNullOrWhiteSpace(accessToken))
return accessToken;

var authHeader = _request.Headers.SafeGet(HeaderType.Authorization).First() ?? string.Empty;
var authHeader = _request.Headers.SafeGet(HeaderType.Authorization).FirstOrDefaultSafe() ?? string.Empty;
if (authHeader.Contains("OAuth") || authHeader.Contains("Bearer"))
accessToken = authHeader.Replace("OAuth ", string.Empty).Replace("Bearer ", string.Empty).Trim();

Expand Down

0 comments on commit b84fe43

Please sign in to comment.