From 24259b77697d71474a1905c913b3a7cb6063ab3e Mon Sep 17 00:00:00 2001 From: macbre Date: Mon, 22 Mar 2021 16:21:48 +0100 Subject: [PATCH] Improve handling of --ignore-ssl-errors option And add a test case See #268 and #271 --- .github/workflows/tests.yml | 3 +++ bin/analyze-css.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 069e2883..a6216651 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,3 +54,6 @@ jobs: - name: Run bin/analyze-css.js for external file over HTTP run: ./bin/analyze-css.js --url http://s3.macbre.net/analyze-css/propertyResets.css -p | jq .metrics + + - name: Run bin/analyze-css.js for external file over HTTPS (--ignore-ssl-errors) + run: ./bin/analyze-css.js --url https://s3.macbre.net/analyze-css/propertyResets.css --ignore-ssl-errors | jq .metrics diff --git a/bin/analyze-css.js b/bin/analyze-css.js index 81e64b3c..8c02d9e4 100755 --- a/bin/analyze-css.js +++ b/bin/analyze-css.js @@ -67,7 +67,7 @@ else { return; } -runnerOpts.ignoreSslErrors = program["ignore-ssl-errors"]; +runnerOpts.ignoreSslErrors = options.ignoreSslErrors === true; runnerOpts.noOffenders = program.offenders === false; runnerOpts.authUser = program["auth-user"]; runnerOpts.authPass = program["auth-pass"];