fix: make public certs always viewable (#36723)

This commit is contained in:
Oliver Eyton-Williams
2019-08-30 12:48:49 +02:00
committed by mrugesh
parent f8a603d182
commit 2785875941

View File

@ -16,8 +16,9 @@ import { wrapHandledError } from '../utils/create-handled-error';
const apiProxyRE = /^\/internal\/|^\/external\//;
const newsShortLinksRE = /^\/internal\/n\/|^\/internal\/p\?/;
const loopbackAPIPathRE = /^\/internal\/api\//;
const showCertRe = /^\/internal\/certificate\/showCert\//;
const _whiteListREs = [newsShortLinksRE, loopbackAPIPathRE];
const _whiteListREs = [newsShortLinksRE, loopbackAPIPathRE, showCertRe];
export function isWhiteListedPath(path, whiteListREs = _whiteListREs) {
return whiteListREs.some(re => re.test(path));