diff --git a/HISTORY.md b/HISTORY.md index 4658f23..448df43 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,9 @@ +1.2.1 / 2017-09-04 +================== + * Fixed bug in image downloads (and any url different from `api.discogs.com`) + 1.2.0 / 2017-06-07 +================== * Query parameter is now optional for `database.search()` * Implemented different request limits for authenticated and non-authenticated clients diff --git a/lib/client.js b/lib/client.js index 79df004..7efb024 100644 --- a/lib/client.js +++ b/lib/client.js @@ -149,16 +149,16 @@ DiscogsClient.prototype.about = function(callback) { DiscogsClient.prototype._rawRequest = function(options, callback) { var data = options.data || null, - method = options.method || 'GET', - urlParts = url.parse(options.url), - encoding = options.encoding || 'utf8'; + method = options.method || 'GET', + urlParts = url.parse(options.url), + encoding = options.encoding || 'utf8'; // Build request headers var headers = { 'User-Agent': this.config.userAgent, 'Accept': 'application/json,application/vnd.discogs.' + this.config.apiVersion + '.' + this.config.outputFormat + '+json,application/octet-stream', 'Accept-Encoding': 'gzip,deflate', - 'Host': this.config.host, + 'Host': urlParts.host || this.config.host, 'Connection': 'close', 'Content-Length': 0 }; diff --git a/package.json b/package.json index 1b84190..d0bff2e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "disconnect", "description": "A full featured Discogs API v2.0 client library", - "version": "1.2.0", + "version": "1.2.1", "keywords": ["discogs", "api", "client", "oauth"], "homepage": "https://github.com/bartve/disconnect", "bugs": "https://github.com/bartve/disconnect/issues",