Skip to content

Commit

Permalink
handle instances where caseless is not defined on response
Browse files Browse the repository at this point in the history
  • Loading branch information
olingern committed Jan 27, 2020
1 parent 64efa3c commit f9f2c53
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/util/request-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,7 @@ export default class RequestManager {
}
}

const server = res.caseless.get('server');

if (res.statusCode === 401 && server === 'GitHub.com') {
if (res.statusCode === 401 && res.caseless && res.caseless.get('server') === 'GitHub.com') {
const message = `${res.body.message}. If using GITHUB_TOKEN in your env, check that it is valid.`;
rejectWithoutUrl(new Error(this.reporter.lang('unauthorizedResponse', server, message)));
}
Expand Down

0 comments on commit f9f2c53

Please sign in to comment.