Skip to content

Commit 2bbfc28

Browse files
author
Brijesh
committed
Caddy order templates before encode
1 parent 8f7b28c commit 2bbfc28

2 files changed

Lines changed: 36 additions & 37 deletions

File tree

Caddyfile

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
{
22
auto_https off
33
}
4-
:2015
5-
6-
root * /srv
7-
file_server
8-
9-
10-
log {
11-
level INFO
12-
}
13-
encode gzip
14-
try_files {path} /index.html
15-
templates /static/js/* {
16-
mime application/javascript
17-
}
18-
19-
header /service-worker.js {
20-
Cache-Control max-age=0,no-cache,no-store,must-revalidate
21-
}
22-
23-
header /index.html {
24-
Cache-Control max-age=0,no-cache,no-store,must-revalidate
25-
}
26-
27-
header /static/* {
28-
Cache-Control max-age=604800,public
29-
}
30-
31-
header /images/* {
32-
Cache-Control max-age=604800,public
33-
}
34-
35-
header /manifest.json {
36-
Cache-Control max-age=3600
4+
:2015 {
5+
root * /srv
6+
log {
7+
level DEBUG
8+
}
9+
templates /static/js/* {
10+
between [[! !]]
11+
mime application/javascript text/javascript
12+
}
13+
14+
encode gzip
15+
try_files {path} /index.html
16+
file_server
17+
header /service-worker.js {
18+
Cache-Control max-age=0,no-cache,no-store,must-revalidate
19+
}
20+
21+
header /index.html {
22+
Cache-Control max-age=0,no-cache,no-store,must-revalidate
23+
}
24+
25+
header /static/* {
26+
Cache-Control max-age=604800,public
27+
}
28+
29+
header /images/* {
30+
Cache-Control max-age=604800,public
31+
}
32+
33+
header /manifest.json {
34+
Cache-Control max-age=3600
35+
}
3736
}

src/constants/api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ export const DEV_ENV = {
3333
};
3434

3535
export const SSO_BASE_URL = isBundled
36-
? '{{env "SSO_BASE_URL"}}' // Caddy will replace this with the environment variable configured in Openshift
36+
? '[[! env "SSO_BASE_URL" !]]' // Caddy will replace this with the environment variable configured in Openshift
3737
: DEV_ENV.SSO_BASE_URL;
3838

39-
export const SSO_REALM_NAME = isBundled ? '{{env "SSO_REALM_NAME"}}' : process.env.REACT_APP_SSO_REALM_NAME;
40-
export const SSO_CLIENT_ID = isBundled ? '{{env "SSO_CLIENT_ID"}}' : process.env.REACT_APP_SSO_CLIENT_ID;
39+
export const SSO_REALM_NAME = isBundled ? '[[! env "SSO_REALM_NAME" !]]' : process.env.REACT_APP_SSO_REALM_NAME;
40+
export const SSO_CLIENT_ID = isBundled ? '[[! env "SSO_CLIENT_ID" !]]' : process.env.REACT_APP_SSO_CLIENT_ID;
4141
export const SSO_BASE_AUTH_ENDPOINT = `${SSO_BASE_URL}/auth/realms/${SSO_REALM_NAME}/protocol/openid-connect`;
4242
export const SSO_LOGIN_REDIRECT_URI = `${window.location.origin}/return-page?type=${RETURN_PAGE_TYPE.LOGIN}`;
4343
export const SSO_LOGIN_ENDPOINT = `${SSO_BASE_AUTH_ENDPOINT}/auth?response_type=code&client_id=${SSO_CLIENT_ID}&redirect_uri=${SSO_LOGIN_REDIRECT_URI}&code_challenge_method=S256&code_challenge=_CODE_CHALLENGE_VALUE_`;
@@ -50,7 +50,7 @@ export const SSO_LOGOUT_ENDPOINT =
5050
encodeURIComponent(SSO_LOGOUT_REDIRECT_URI) +
5151
`&client_id=${SSO_CLIENT_ID}`;
5252

53-
export const SITEMINDER_BASE_URL = isBundled ? '{{env "SITEMINDER_BASE_URL"}}' : DEV_ENV.SITEMINDER_BASE_URL;
53+
export const SITEMINDER_BASE_URL = isBundled ? '[[! env "SITEMINDER_BASE_URL" !]]' : DEV_ENV.SITEMINDER_BASE_URL;
5454

5555
export const SITEMINDER_LOGOUT_REDIRECT_URI = `${window.location.origin}/return-page?type=${RETURN_PAGE_TYPE.SITEMINDER_LOGOUT}`;
5656
export const SITEMINDER_LOGOUT_ENDPOINT =

0 commit comments

Comments
 (0)