Skip to content

Commit

Permalink
Merge pull request node-js-libs#49 from jhurliman/master
Browse files Browse the repository at this point in the history
Add response.url parameter and give jsdom proper URLs
  • Loading branch information
chriso committed Aug 18, 2011
2 parents a942cf3 + 94b9426 commit f39a4fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/node.io/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Job.prototype.parseHtml = function (data, callback, response) {
};
var $, window, jquery, default_$;
try {
window = require('jsdom').jsdom(data, null, {features:features}).createWindow();
window = require('jsdom').jsdom(data, null, {features:features, url:response.url}).createWindow();
jquery = require('jquery');
default_$ = jquery.create(window);
$ = function (selector, context) {
Expand Down
2 changes: 2 additions & 0 deletions lib/node.io/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ Job.prototype.doRequest = function (method, resource, body, headers, callback, p

request = (secure ? https : http).request(options, function (response) {

response.url = resource;

request_reponse = response;

if (self.is_complete) {
Expand Down

0 comments on commit f39a4fb

Please sign in to comment.