Skip to content

Commit

Permalink
Fixed IO redirection from non-https to https resource
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Oct 18, 2011
1 parent 760d2b2 commit f453fba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/yui3-io.js
Expand Up @@ -46,8 +46,9 @@ YUI.add('io-nodejs', function(Y) {
Y.log('Requesting (' + config.method + '): ' + urlInfo.hostname, 'info', 'nodeio');
if (http.get) { //0.4.0
Y.log('Using new 0.4.0 http.request', 'info', 'nodeio');
var h = (p === 443) ? https : http;
if (p === 443) {
var h = ((urlInfo.protocol === 'https') || p === 443) ? https : http;

if (h === https) {
Y.log('Using HTTPS client', 'info', 'nodeio');
}
var request = h.request({
Expand Down
14 changes: 14 additions & 0 deletions tests/interface.js
Expand Up @@ -109,6 +109,20 @@ suite.add( new YUITest.TestCase({
next();
});
}),
"io test" : async(function (data, next) {
yui3.silent().use("loader", 'io', function (Y) {
Y.io('http://login.yahoo.com/', {
on: {
success: function(id, e) {
Assert.isObject(Y.Loader);
Assert.isFunction(Y.io);
//It made it here, no socket hang up
next();
}
}
});
});
}),
"uploader test" : async(function (data, next) {
var core = require('./node_modules/yui3/node_modules/yui3-core');
yui3.configure({ debug: false, '2in3': false, gallery: false, yuiPath: core.path(), yuiCoreFile: 'build/yui/yui-debug.js' }).use("uploader", function (Y) {
Expand Down

0 comments on commit f453fba

Please sign in to comment.