hdoc-tools 0.35.5 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hdoc-validate.js +12 -3
- package/package.json +1 -1
package/hdoc-validate.js
CHANGED
@@ -344,7 +344,7 @@ const e = require("express");
|
|
344
344
|
)
|
345
345
|
redir_errors.push(`Invalid redirect code: ${redirects[key].code}`);
|
346
346
|
|
347
|
-
if (redirects[key].location) {
|
347
|
+
if (redirects[key].location && !redirects[key].skip_location_validation) {
|
348
348
|
const redir_locations = [
|
349
349
|
path.join(source_path, `${redirects[key].location}.md`),
|
350
350
|
path.join(source_path, redirects[key].location, "index.md"),
|
@@ -378,6 +378,9 @@ const e = require("express");
|
|
378
378
|
if (redirects[nav_path]) {
|
379
379
|
response.exists = true;
|
380
380
|
if (redirects[nav_path].location) {
|
381
|
+
|
382
|
+
if (redirects[nav_path].skip_location_validation) return response;
|
383
|
+
|
381
384
|
// We have a redirect, check if it's a valid location
|
382
385
|
let file_path = path.join(
|
383
386
|
source_path,
|
@@ -599,8 +602,14 @@ const e = require("express");
|
|
599
602
|
return res.status;
|
600
603
|
}, links[i]);
|
601
604
|
}
|
602
|
-
if ((status < 200 || status > 299) && status !== 304)
|
603
|
-
|
605
|
+
if ((status < 200 || status > 299) && status !== 304) {
|
606
|
+
if (status === 403 && links[i].includes(".hornbill.com")) {
|
607
|
+
// STEVEG - do nothing here, as it always returns a 403 for Hornbill sites when accessing through GitHub Actions
|
608
|
+
// Works totally fine locally or in hdocpub, still trying to work out what's causing this in GitHub
|
609
|
+
} else {
|
610
|
+
throw `Unexpected Status Returned: ${status}`;
|
611
|
+
}
|
612
|
+
}
|
604
613
|
}
|
605
614
|
} catch (error) {
|
606
615
|
throw error;
|