Closed ecormany closed 3 days ago
Solved it! It's failing for sites with bad (but still functional) certificates. This is intended axios
behavior and can be circumvented in Doc Detective with an environment variable.
I added this to my test from above:
{
"action": "setVariables",
"path": "ignore-certificate-problems.env"
},
And put this in the .env file:
NODE_TLS_REJECT_UNAUTHORIZED=0
It works 🎉
{
"result": "PASS",
"resultDescription": "Returned 200",
"description": "Check Help Center.",
"action": "checkLink",
"url": "https://support.opentrons.com/s/",
"statusCodes": [
200,
201,
202,
301
],
"id": "ce639aff-cb40-4b66-90c1-35dc29a35ff5"
}
Reopening the issue and transferring to the docs repo. You may be the first to run into this issue, but you won't be the last.
Out of curiosity, is the cert issue known or intentional? Or are you simply wanting to test it regardless of certificate validity?
Need to create an example of running a checkLint action against a URL with an internal or custom certificate that may not be recognized on the machine doing the testing but is nonetheless valid.
The checkLink action is failing for some valid URLs. For example, I saved this standalone test as
help-center.json
:Running it produces a failure.
The page is a valid URL and loads without redirects.
Other URL checking services get a 200 response for the page, e.g. https://www.pemavor.com/solution/http-status-code-checker/