Added switch --insecure to allow imports from insecure/self-signed SSL certificates

This commit is contained in:
Christophe Robin
2013-07-11 16:45:23 +09:00
parent 290376f4eb
commit 2d1afdfe91
4 changed files with 7 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
'contents', // browser-only, contents of all the files
'relativeUrls', // option - whether to adjust URL's to be relative
'strictImports', // option -
'insecure', // option - whether to allow imports from insecure ssl hosts
'dumpLineNumbers', // option - whether to dump line numbers
'compress', // option - whether to compress
'processImports', // option - whether to process imports. if false then imports will not be imported

View File

@@ -161,7 +161,7 @@ less.Parser.importer = function (file, currentFileInfo, callback, env) {
path: urlObj.pathname + (urlObj.search||'')
};
request.get(urlStr, function (error, res, body) {
request.get({uri: urlStr, strictSSL: !env.insecure }, function (error, res, body) {
if (res.statusCode === 404) {
callback({ type: 'File', message: "resource '" + urlStr + "' was not found\n" });
return;

View File

@@ -36,6 +36,7 @@ var lessc_helper = {
sys.puts(" -l, --lint Syntax check only (lint).");
sys.puts(" -s, --silent Suppress output of error messages.");
sys.puts(" --strict-imports Force evaluation of imports.");
sys.puts(" --insecure Allow imports from insecure https hosts.");
sys.puts(" --verbose Be verbose.");
sys.puts(" -v, --version Print version number and exit.");
sys.puts(" -x, --compress Compress output by removing some whitespaces.");