fix #1 use os.tmpdir() and use all defined options

This commit is contained in:
AJ ONeal 2016-08-11 00:59:03 -06:00
父節點 1be85e24de
當前提交 28f0a34e1e
共有 1 個檔案被更改,包括 3 行新增2 行删除

查看文件

@ -4,7 +4,8 @@ var fs = require('fs');
var path = require('path');
var defaults = {
webrootPath: [ '~', 'letsencrypt', 'var', 'lib' ].join(path.sep)
//webrootPath: [ '~', 'letsencrypt', 'var', 'lib' ].join(path.sep)
webrootPath: require('os').tmpdir() + path.sep + 'acme-challenge'
, debug: false
};
@ -19,7 +20,7 @@ Challenge.create = function (options) {
results.create = undefined;
Object.keys(defaults).forEach(function (key) {
if (!(key in options)) {
if ('undefined' !== typeof options[key]) {
options[key] = defaults[key];
}
});