Permalink
Browse files

Minor fixes

  • Loading branch information...
1 parent 7963254 commit 2e56985e4d479f76b3f2259229cd415cd4812e69 @chriso chriso committed Jun 21, 2011
Showing with 3 additions and 6 deletions.
  1. +3 −6 lib/node.io/request.js
@@ -261,10 +261,7 @@ Job.prototype.doRequest = function (method, resource, body, headers, callback, p
//Copy `headers` before modifying it
headers = utils.put({}, headers);
- //Set the host header to the URL host unless it's already defined
- if (typeof headers.host === 'undefined') {
- headers.host = url.hostname;
- }
+ headers.host = url.hostname;
//Add headers set before the doRequest call if from the same host (e.g. cookie, user-agent, referer, etc.)
if (typeof this.last.headers === 'object' && this.last.host === url.hostname) {
@@ -584,11 +581,11 @@ var HttpProxy = function (host) {
var url_callback = function (url) {
var u = urlparse(url);
this.url_host = u.host;
- url = u.protocol + '//' + u.host + '/' + u.pathname;
+ url = host + u.pathname;
if (u.search) {
url += u.search;
}
- return u;
+ return url;
};
var header_callback = function (headers) {
headers = headers || {};

0 comments on commit 2e56985

Please sign in to comment.