diff --git a/Dockerfile b/Dockerfile index a2011f0b..3138a1a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN apt-get update \ && apt-get update \ && apt-get install -y \ procps=2:3.3.12-3+deb9u1 \ - google-chrome-stable=91.0.4472.101-1 \ + google-chrome-stable=91.0.4472.106-1 \ fonts-ipafont-gothic=00303-16 \ fonts-wqy-zenhei=0.9.45-6 \ fonts-thai-tlwg=1:0.6.3-1 \ diff --git a/src/worker/renderers/chrome/browserRequestHandler.js b/src/worker/renderers/chrome/browserRequestHandler.js index 097c26e7..61fa9689 100644 --- a/src/worker/renderers/chrome/browserRequestHandler.js +++ b/src/worker/renderers/chrome/browserRequestHandler.js @@ -4,10 +4,8 @@ import { T, anyPass, complement, cond, equals, find, ifElse, isNil, pipe, replac const resolveRequestDomain = req => req.url().match(/^(https?:\/\/)?(?[^/]+)/).groups.host // isMatchingDomain :: String -> String -> Boolean -const isMatchingDomain = input => anyPass([ - equals('*'), - value => test(new RegExp(`${value}$`, 'i'), input), -]) +const isMatchingDomain = input => value => + test(new RegExp(`^${replace('*', '.*', value)}$`, 'i'), input) // isRequestDomainAuthorized :: [String] -> Request -> Boolean const isRequestDomainAuthorized = authorizedRequestDomains => pipe( diff --git a/src/worker/renderers/chrome/browserRequestHandler.test.js b/src/worker/renderers/chrome/browserRequestHandler.test.js index 9dde0915..1ec8440f 100644 --- a/src/worker/renderers/chrome/browserRequestHandler.test.js +++ b/src/worker/renderers/chrome/browserRequestHandler.test.js @@ -79,7 +79,7 @@ describe('worker :: renderer :: browserRequestHandler', () => { const configuration = { worker: { renderer: { - authorized_request_domains: ['example.com'], + authorized_request_domains: ['*.example.com'], authorized_request_resources: ['*'], redirections: [], }, @@ -150,7 +150,7 @@ describe('worker :: renderer :: browserRequestHandler', () => { const configuration = { worker: { renderer: { - authorized_request_domains: ['example.com'], + authorized_request_domains: ['*.example.com'], authorized_request_resources: ['document'], redirections: [], },