Skip to content
Browse files

Adds a url parameter to the response object and passes the URL into j…

…sdom to avoid setting the jQuery document URL to __dirname
  • Loading branch information...
1 parent b26a86c commit 94b9426f2c4b62cae4c505cd7faf0a335ad9041d @jhurliman jhurliman committed
Showing with 3 additions and 1 deletion.
  1. +1 −1 lib/node.io/dom.js
  2. +2 −0 lib/node.io/request.js
View
2 lib/node.io/dom.js
@@ -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) {
View
2 lib/node.io/request.js
@@ -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) {

0 comments on commit 94b9426

Please sign in to comment.
Something went wrong with that request. Please try again.