fix(security): prevent caching of sensitive API responses
This commit is contained in:
@@ -53,6 +53,12 @@ const securityHeaders = [
|
||||
// value: "frame-src 'self'; child-src 'self';object-src 'none'; script-src 'self' 'https://www.googletagmanager.com' unsafe-inline",
|
||||
// },
|
||||
];
|
||||
const noStoreHeaders = [
|
||||
{
|
||||
key: "Cache-Control",
|
||||
value: "no-store"
|
||||
}
|
||||
];
|
||||
//const buildId = nextBuildId.sync({ dir: __dirname });
|
||||
const buildId = Date.now().toString();
|
||||
|
||||
@@ -77,6 +83,30 @@ module.exports = {
|
||||
// Apply these headers to all routes in your application.
|
||||
source: "/(.*)?",
|
||||
headers: securityHeaders
|
||||
},
|
||||
{
|
||||
source:
|
||||
"/api/:family(admin|email|file|myportal|subscriptions)/:path*",
|
||||
headers: noStoreHeaders
|
||||
},
|
||||
{
|
||||
source: "/api/auth/resolve-locale",
|
||||
headers: noStoreHeaders
|
||||
},
|
||||
{
|
||||
source:
|
||||
"/api/endpoint/:route(createaccount_api|getaccounts_api|getemailaccountcheck_api|getpersonalaccount_api|getportallogin_api|getportalloginproxy_api|getpreferredlanguage_api|updateaccount_api|gethash_api|createcrmtask_api)",
|
||||
headers: noStoreHeaders
|
||||
},
|
||||
{
|
||||
source:
|
||||
"/api/endpoint/:route(getmycases_api|getmylpacases_api|getmyrepresentations_api|getmyrepresentationsproxy_api|getawaitingsubmission_api|getawaitingsubmissionproxy_api|getwatchedcases_api|getwatchedcasesproxy_api|createwatchedcases_api|deletewatchedcases_api|deletewatchedcasesproxy_api|deleteawaitingsubmissions_api)",
|
||||
headers: noStoreHeaders
|
||||
},
|
||||
{
|
||||
source:
|
||||
"/api/endpoint/:route(getbasicpartsaveddetails_api|getpartsavedappeal_api|getappealid_api|getappealpdfdocuments_api|getportalmoduledetails_api|getportalmoduledetailsproxy_api|patchcase_api|updatecase_api)",
|
||||
headers: noStoreHeaders
|
||||
}
|
||||
];
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user