Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
fix(prefetch): ensure REPO_RAW_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
tripodsan committed Jun 22, 2019
1 parent 9921123 commit a8728db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a8728db

Please sign in to comment.