Skip to content

Commit

Permalink
Fix host/hostname confusion.
Browse files Browse the repository at this point in the history
Introduced in 0.8.0, diagnosed in Automattic#66 (comment).
  • Loading branch information
domenic committed May 20, 2013
1 parent 309133c commit 2400475
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,16 @@ var Client = module.exports = exports = function Client(options) {
*/

Client.prototype.request = function(method, filename, headers){
var options = { hostname: this.endpoint, agent: this.agent }
var options = { hostname: this.host, agent: this.agent }
, date = new Date
, headers = headers || {}
, fixedFilename = encodeSpecialCharacters(ensureLeadingSlash(filename));

// Default headers
utils.merge(headers, {
Date: date.toUTCString()
, Host: this.host
});
headers.Date = date.toUTCString()
if (this.style === 'virtualHosted') {
headers.Host = this.host;
}

if ('undefined' != typeof this.token)
headers['x-amz-security-token'] = this.token;
Expand Down

0 comments on commit 2400475

Please sign in to comment.