Comparing version 7.0.0 to 7.0.1
# CHANGELOG | ||
## 7.0.1 | ||
Bug fixes: | ||
* Fix enterprise uploadAsset edge case. | ||
## 7.0.0 | ||
@@ -4,0 +9,0 @@ |
@@ -27,5 +27,4 @@ "use strict"; | ||
name: "z.sh" | ||
}, function(err, res) { | ||
console.log(err, res); | ||
}); |
@@ -5,2 +5,3 @@ "use strict"; | ||
var fs = require("fs"); | ||
var HttpsProxyAgent = require('https-proxy-agent'); | ||
var mime = require("mime"); | ||
@@ -622,14 +623,25 @@ var netrc = require("netrc"); | ||
var format = getRequestFormat.call(this, hasBody, block); | ||
var protocol = this.config.protocol || this.constants.protocol || "http"; | ||
var port = this.config.port || (protocol == "https" ? 443 : 80); | ||
var host = block.host || this.config.host || this.constants.host; | ||
// Edge case for github enterprise uploadAsset: | ||
// 1) In public api, host changes to uploads.github.com. In enterprise, the host remains the same. | ||
// 2) In enterprise, the pathPrefix changes from: /api/v3 to /api/uploads. | ||
if ((this.config.host && this.config.host !== this.constants.host) | ||
&& (block.host && block.host === "uploads.github.com")) { // enterprise uploadAsset | ||
host = this.config.host; | ||
this.config.pathPrefix = "/api/uploads"; | ||
} | ||
var obj = getQueryAndUrl(msg, block, format, self.config); | ||
var query = obj.query; | ||
var url = this.config.url ? this.config.url + obj.url : obj.url; | ||
var HttpsProxyAgent = require('https-proxy-agent'); | ||
var agent = undefined; | ||
var path = url; | ||
var protocol = this.config.protocol || this.constants.protocol || "http"; | ||
var host = block.host || this.config.host || this.constants.host; | ||
var port = this.config.port || (protocol == "https" ? 443 : 80); | ||
if (!hasBody && query.length) { | ||
path += "?" + query.join("&"); | ||
} | ||
var proxyUrl; | ||
var ca = this.config.ca; | ||
var agent = undefined; | ||
if (this.config.proxy !== undefined) { | ||
@@ -643,5 +655,4 @@ proxyUrl = this.config.proxy; | ||
} | ||
if (!hasBody && query.length) { | ||
path += "?" + query.join("&"); | ||
} | ||
var ca = this.config.ca; | ||
@@ -648,0 +659,0 @@ var headers = { |
{ | ||
"name": "github", | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"description": "NodeJS wrapper for the GitHub API", | ||
@@ -52,3 +52,3 @@ "author": "Mike de Boer <info@mikedeboer.nl>", | ||
"name": "node-github", | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"template": { | ||
@@ -55,0 +55,0 @@ "withCompare": true |
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
1734566
73
46842