Skip to content

Commit

Permalink
Always populate the authorization header unless explicitly undefined …
Browse files Browse the repository at this point in the history
…property is present
  • Loading branch information
dylanbr committed May 18, 2017
1 parent e90bd56 commit 899666b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/interceptors/oauth-interceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ function oauthInterceptor($q, $rootScope, OAuthToken) {
config.headers = config.headers || {};

// Inject `Authorization` header.
if (!config.headers.hasOwnProperty('Authorization') && OAuthToken.getAuthorizationHeader()) {
if (
(
!config.headers.hasOwnProperty('Authorization') || typeof config.headers.Authorization !== 'undefined'
) && OAuthToken.getAuthorizationHeader()
) {
config.headers.Authorization = OAuthToken.getAuthorizationHeader();
}

Expand Down

0 comments on commit 899666b

Please sign in to comment.