From a8728db016367efff34d25a8e326da4ad7e10ebc Mon Sep 17 00:00:00 2001 From: Tobias Bocanegra Date: Sat, 22 Jun 2019 19:45:42 +0900 Subject: [PATCH] fix(prefetch): ensure REPO_RAW_ROOT --- src/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index adea9f48..dcf8ef58 100644 --- a/src/utils.js +++ b/src/utils.js @@ -26,9 +26,10 @@ async function preFetch(context, { secrets = {}, request, logger }) { if (!path.endsWith('.md')) { return; } + const rootUrl = secrets.REPO_RAW_ROOT || 'https://raw.githubusercontent.com/'; const sel = selector ? `.${selector}` : ''; const htmlPath = `${owner}/${repo}/${ref}/${path.substring(0, path.length - 3)}${sel}.${extension}`.replace(/\/+/g, '/'); - const url = `${secrets.REPO_RAW_ROOT}${htmlPath}`; + const url = `${rootUrl}${htmlPath}`; logger.info(`trying to load ${url}`); if (!context.response) {