Permalink
Browse files

Request can take a "scheme" option. This way we can make XHRs to http…

…s sites.
  • Loading branch information...
1 parent b591659 commit 3f66ebccb1c7e005d1cde2605edda3cddc70cfdb Nicolas LaCasse committed Jan 19, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/request.js
View
4 lib/request.js
@@ -8,7 +8,9 @@ var Request = module.exports = function (xhr, params) {
var uri = params.host + ':' + params.port + (params.path || '/');
- xhr.open(params.method || 'GET', 'http://' + uri, true);
+ xhr.open( params.method || 'GET',
+ (params.scheme || 'http') + '://' + uri,
+ true);
if (params.headers) {
Object.keys(params.headers).forEach(function (key) {

0 comments on commit 3f66ebc

Please sign in to comment.