Skip to content

Commit 326b4f5

Browse files
committed
Add e2e test to test if sensitive config property is available
1 parent f3b7d30 commit 326b4f5

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
describe('Limit public config properties', () => {
2+
it('Should not include cache.serverSide properties in the html source code',
3+
() => {
4+
cy.request('/').its('body').then((text: string) => {
5+
expect(text).to.not.contain('"serverSide":');
6+
});
7+
},
8+
);
9+
it('Should not include cache.serverSide properties in the config.json',
10+
() => {
11+
cy.request('/assets/config.json').its('body').then((obj: any) => {
12+
expect(obj.cache).to.not.haveOwnProperty('serverSide');
13+
});
14+
},
15+
);
16+
});

src/config/config.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const overrideWithConfig = (config: Config, pathToConfig: string) => {
121121
try {
122122
console.log(`Overriding app config with ${pathToConfig}`);
123123
const externalConfig = readFileSync(pathToConfig, 'utf8');
124-
mergeConfig(config, load(externalConfig));
124+
mergeConfig(config, load(externalConfig) as AppConfig);
125125
} catch (err) {
126126
console.error(err);
127127
}

0 commit comments

Comments
 (0)