jspm-github
Advanced tools
Comparing version 0.13.20 to 0.13.21
@@ -0,0 +0,0 @@ var Promise = require('rsvp').Promise; |
@@ -275,7 +275,7 @@ var fs = require('graceful-fs'); | ||
function checkRateLimit(headers) { | ||
if (headers.status.match(/^401/)) | ||
function checkRateLimit(statusCode, headers) { | ||
if (statusCode === 401) | ||
throw 'Unauthorized response for GitHub API.\n' + | ||
'Use %jspm registry config github% to reconfigure the credentials, or update them in your ~/.netrc file.'; | ||
if (headers.status.match(/^406/)) | ||
if (statusCode === 406) | ||
throw 'Unauthorized response for GitHub API.\n' + | ||
@@ -457,3 +457,3 @@ 'If using an access token ensure it has public_repo access.\n' + | ||
)).then(function(res) { | ||
var rateLimitResponse = checkRateLimit.call(this, res.headers); | ||
var rateLimitResponse = checkRateLimit.call(this, res.statusCode, res.headers); | ||
if (rateLimitResponse) | ||
@@ -664,3 +664,3 @@ return rateLimitResponse; | ||
)).on('response', function(archiveRes) { | ||
var rateLimitResponse = checkRateLimit.call(this, archiveRes.headers); | ||
var rateLimitResponse = checkRateLimit.call(this, archiveRes.statusCode, archiveRes.headers); | ||
if (rateLimitResponse) | ||
@@ -756,3 +756,3 @@ return rateLimitResponse.then(resolve, reject); | ||
.then(function(res) { | ||
var rateLimitResponse = checkRateLimit.call(this, res.headers); | ||
var rateLimitResponse = checkRateLimit.call(this, res.statusCode, res.headers); | ||
if (rateLimitResponse) | ||
@@ -759,0 +759,0 @@ return rateLimitResponse; |
{ | ||
"name": "jspm-github", | ||
"version": "0.13.20", | ||
"version": "0.13.21", | ||
"description": "jspm GitHub endpoint", | ||
@@ -5,0 +5,0 @@ "main": "github.js", |
@@ -0,0 +0,0 @@ var Pool = require('../pool'); |
global.Promise = require('rsvp').Promise; | ||
global.assert = require('assert'); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29382