From 3010bd6cdd40967e83ab8be2f83d2b7c667b593e Mon Sep 17 00:00:00 2001 From: Darren Date: Fri, 14 Oct 2011 23:42:43 +0100 Subject: [PATCH] HTTP plugin handler SSL detection fix --- server/app.js | 2 +- server/kiwi_modules/forcessl.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.25.1