From: Darren Date: Fri, 14 Oct 2011 22:42:43 +0000 (+0100) Subject: HTTP plugin handler SSL detection fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3010bd6cdd40967e83ab8be2f83d2b7c667b593e;p=KiwiIRC.git HTTP plugin handler SSL detection fix --- diff --git a/server/app.js b/server/app.js index 8e970ad..a36bfdb 100644 --- a/server/app.js +++ b/server/app.js @@ -535,7 +535,7 @@ this.httpHandler = function (request, response) { //try { if (kiwi.config.handle_http) { // Run through any plugins.. - args = {request: request, response: response}; + args = {request: request, response: response, ssl: secure}; obj = kiwi.kiwi_mod.run('http', args); if (obj === null) { return; diff --git a/server/kiwi_modules/forcessl.js b/server/kiwi_modules/forcessl.js index fb94983..b8ae4e5 100644 --- a/server/kiwi_modules/forcessl.js +++ b/server/kiwi_modules/forcessl.js @@ -6,12 +6,12 @@ var kiwi = require('../kiwi.js'); -exports.onhttp = function (ev) { +exports.onhttp = function (ev, opts) { var host, port = null, i; // TODO: request.socket.pair seems to only be set in a SSL req, is this // the best way to check for this? - if (typeof ev.request.socket.pair === 'undefined') { + if (!opts.ssl) { host = ev.request.headers.host; // Remove the port if one is set