Skip to content

Commit

Permalink
Fix flowtype checks
Browse files Browse the repository at this point in the history
  • Loading branch information
vbfox committed Oct 22, 2016
1 parent aae4041 commit b18825a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/registries/npm-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export default class NpmRegistry extends Registry {

const headers = {};
if (this.token || (alwaysAuth && requestUrl.startsWith(registry))) {
headers.authorization = this.getAuth(pathname);
const authorization = this.getAuth(pathname);
if (authorization) {
headers.authorization = authorization;
}
}

return this.requestManager.request({
Expand Down Expand Up @@ -148,7 +151,7 @@ export default class NpmRegistry extends Registry {
return DEFAULT_REGISTRY;
}

getAuth(packageName: string): string {
getAuth(packageName: string): ?string {
if (this.token) {
return this.token;
}
Expand Down

0 comments on commit b18825a

Please sign in to comment.