From 788cfaebe118eb3c181a301da8ab49c72e003948 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 12 Dec 2015 15:19:11 +0000 Subject: [PATCH] tested working :-) --- bin/standalone.js | 9 ++------- index.js | 15 +++------------ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/bin/standalone.js b/bin/standalone.js index 434cb61..234d872 100644 --- a/bin/standalone.js +++ b/bin/standalone.js @@ -24,24 +24,19 @@ var bkDefaults = { webroot: true , webrootPath: path.join(__dirname, '..', 'tests', 'acme-challenge') , fullchainTpl: '/live/:hostname/fullchain.pem' -, privkeyTpl: '/live/:hostname/fullchain.pem' +, privkeyTpl: '/live/:hostname/privkey.pem' , configDir: path.join(__dirname, '..', 'tests', 'letsencrypt.config') , logsDir: path.join(__dirname, '..', 'tests', 'letsencrypt.logs') , workDir: path.join(__dirname, '..', 'tests', 'letsencrypt.work') , server: LEP.stagingServer , text: true }; -var le = require('../').create(lep, bkDefaults, { -}); +var le = require('../').create(lep, bkDefaults, { }); var localCerts = require('localhost.daplie.com-certificates'); var express = require('express'); var app = express(); -app.use('/', function (req, res, next) { - console.log('[DEBUG]', req.method, req.protocol, req.hostname, req.url); - next(); -}); app.use('/', le.middleware()); var server = require('http').createServer(); diff --git a/index.js b/index.js index df2e372..20bfdd7 100644 --- a/index.js +++ b/index.js @@ -77,8 +77,8 @@ module.exports.create = function (letsencrypt, defaults, options) { return PromiseA.resolve(); } , middleware: function () { - console.log('[DEBUG] webrootPath', defaults.webrootPath); - var serveStatic = require('serve-static')(defaults.webrootPath); + //console.log('[DEBUG] webrootPath', defaults.webrootPath); + var serveStatic = require('serve-static')(defaults.webrootPath, { dotfiles: 'allow' }); var prefix = '/.well-known/acme-challenge/'; return function (req, res, next) { @@ -87,16 +87,7 @@ module.exports.create = function (letsencrypt, defaults, options) { return; } - console.log('[DEBUG] req.url 0', req.url); - var pathname = req.url; - req.url = req.url.substr(prefix.length - 1); - console.log('[DEBUG] req.url 1', req.url); - serveStatic(req, res, function (err) { - console.log('[DEBUG] req.url 2', req.url); - req.url = pathname; - console.log('[DEBUG] req.url 3', req.url); - next(err); - }); + serveStatic(req, res, next); }; } , SNICallback: sniCallback