Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow imports from self-signed SSL hosts #1412

Merged
merged 1 commit into from
Sep 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bin/lessc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var options = {
paths: [],
color: true,
strictImports: false,
insecure: false,
rootpath: '',
relativeUrls: false,
ieCompat: true,
Expand Down Expand Up @@ -90,6 +91,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;
Expand Down
1 change: 1 addition & 0 deletions lib/less/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/less/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/less/lessc_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down