Skip to content

Commit 899666b

Browse files
committedMay 18, 2017
Always populate the authorization header unless explicitly undefined property is present
1 parent e90bd56 commit 899666b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/interceptors/oauth-interceptor.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ function oauthInterceptor($q, $rootScope, OAuthToken) {
99
config.headers = config.headers || {};
1010

1111
// Inject `Authorization` header.
12-
if (!config.headers.hasOwnProperty('Authorization') && OAuthToken.getAuthorizationHeader()) {
12+
if (
13+
(
14+
!config.headers.hasOwnProperty('Authorization') || typeof config.headers.Authorization !== 'undefined'
15+
) && OAuthToken.getAuthorizationHeader()
16+
) {
1317
config.headers.Authorization = OAuthToken.getAuthorizationHeader();
1418
}
1519

0 commit comments

Comments
 (0)