@octokit/rest
Advanced tools
Comparing version 15.2.6 to 15.2.7
module.exports = { | ||
agent: undefined, // https://nodejs.org/api/https.html#https_class_https_agent | ||
headers: {}, | ||
requestMedia: 'application/vnd.github.v3+json', | ||
headers: { | ||
accept: 'application/vnd.github.v3+json' | ||
}, | ||
timeout: 0, | ||
baseUrl: 'https://api.github.com' | ||
} |
@@ -12,4 +12,3 @@ module.exports = parseOptions | ||
'agent', | ||
'headers', | ||
'requestMedia' | ||
'headers' | ||
] | ||
@@ -16,0 +15,0 @@ |
@@ -42,4 +42,2 @@ 'use strict' | ||
.then(response => { | ||
const contentType = response.headers.get('content-type') | ||
for (const keyAndValue of response.headers.entries()) { | ||
@@ -53,2 +51,11 @@ headers[keyAndValue[0]] = keyAndValue[1] | ||
// GitHub API returns 200 for HEAD requsets | ||
if (requestOptions.method === 'HEAD') { | ||
if (response.status < 400) { | ||
return | ||
} | ||
throw new HttpError(response.statusText, response.status, headers) | ||
} | ||
if (response.status === 304) { | ||
@@ -67,2 +74,3 @@ requestOptions.url = response.headers.location | ||
const contentType = response.headers.get('content-type') | ||
if (/application\/json/.test(contentType)) { | ||
@@ -69,0 +77,0 @@ return response.json() |
{ | ||
"name": "@octokit/rest", | ||
"version": "15.2.6", | ||
"version": "15.2.7", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -61,4 +61,4 @@ # rest.js | ||
timeout: 0, // 0 means no request timeout | ||
requestMedia: 'application/vnd.github.v3+json', | ||
headers: { | ||
accept: 'application/vnd.github.v3+json', | ||
'user-agent': 'octokit/rest.js v1.2.3' // v1.2.3 will be current version | ||
@@ -65,0 +65,0 @@ }, |
Sorry, the diff of this file is too big to display
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
564776
14763