fix: quote nginx cache regex
This commit is contained in:
@@ -8,6 +8,10 @@ const containerfile = readFileSync(
|
||||
path.join(projectRoot, 'Containerfile.release'),
|
||||
'utf8'
|
||||
);
|
||||
const nginxConfig = readFileSync(
|
||||
path.join(projectRoot, 'deploy', 'nginx.conf'),
|
||||
'utf8'
|
||||
);
|
||||
const releaseLock = JSON.parse(
|
||||
readFileSync(path.join(projectRoot, 'release', 'toolbox.lock.json'), 'utf8')
|
||||
) as { releaseVersion: string };
|
||||
@@ -51,7 +55,7 @@ describe('production deployment', () => {
|
||||
'traefik.docker.network: "${TRAEFIK_NETWORK:-internal}"'
|
||||
);
|
||||
expect(compose).toContain(
|
||||
'traefik.http.routers.addideas-toolbox.rule: "Host(`${TOOLBOX_HOST:-toolbax.add-ideas.de}`)"'
|
||||
'traefik.http.routers.addideas-toolbox.rule: "Host(`${TOOLBOX_HOST:-toolbox.add-ideas.de}`)"'
|
||||
);
|
||||
expect(compose).toContain(
|
||||
'traefik.http.routers.addideas-toolbox.entrypoints: websecure'
|
||||
@@ -62,4 +66,11 @@ describe('production deployment', () => {
|
||||
expect(compose).toContain('external: true');
|
||||
expect(compose).not.toMatch(/^\s+ports:/mu);
|
||||
});
|
||||
|
||||
it('quotes nginx regular expressions that contain brace quantifiers', () => {
|
||||
expect(nginxConfig).toContain(
|
||||
'"~^/(?:.*/)?assets/.*-[A-Za-z0-9_-]{8,}\\.[^/]+$"'
|
||||
);
|
||||
expect(nginxConfig).not.toMatch(/^\s*~[^\n]*\{\d/mu);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user