Skip to content

Commit

Permalink
Fixed an issue with IO and 30x redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Nov 5, 2010
1 parent 840489b commit 19e61ce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ YUI.add('io-nodejs', function(Y) {
case 301:
case 302:
if (response.headers.location) {
Y.log('Status code (' + response.statusCode + ') redirecting to: ' + response.headers.location, 'info', 'nodeio');
NodeTransport.src.send(response.headers.location, transactionObject, config);
var newUrl = response.headers.location;
if (newUrl.substr(0, 1) == '/') {
newUrl = urlInfo.protocol + '/'+'/' + urlInfo.hostname + newUrl;
}
Y.log('Status code (' + response.statusCode + ') redirecting to: ' + newUrl, 'info', 'nodeio');
NodeTransport.src.send(newUrl, transactionObject, config);
return;
}
break;
Expand Down

0 comments on commit 19e61ce

Please sign in to comment.