mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Merge pull request #1412 from christopherobin/master
Allow imports from self-signed SSL hosts
This commit is contained in:
@@ -20,6 +20,7 @@ var options = {
|
||||
paths: [],
|
||||
color: true,
|
||||
strictImports: false,
|
||||
insecure: false,
|
||||
rootpath: '',
|
||||
relativeUrls: false,
|
||||
ieCompat: true,
|
||||
@@ -92,6 +93,9 @@ args = args.filter(function (arg) {
|
||||
case 'compress':
|
||||
options.compress = true;
|
||||
break;
|
||||
case 'insecure':
|
||||
options.insecure = true;
|
||||
break;
|
||||
case 'M':
|
||||
case 'depends':
|
||||
options.depends = true;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
'relativeUrls', // option - whether to adjust URL's to be relative
|
||||
'rootpath', // option - rootpath to append to URL's
|
||||
'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
|
||||
|
||||
@@ -148,7 +148,7 @@ less.Parser.fileLoader = function (file, currentFileInfo, callback, env) {
|
||||
var urlStr = isUrl ? file : url.resolve(currentFileInfo.currentDirectory, file),
|
||||
urlObj = url.parse(urlStr);
|
||||
|
||||
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;
|
||||
|
||||
@@ -37,6 +37,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.");
|
||||
|
||||
Reference in New Issue
Block a user