@sap-ux/fe-mockserver-core
Advanced tools
Comparing version 1.1.48 to 1.1.49
@@ -38,15 +38,2 @@ "use strict"; | ||
/** | ||
* Small middleware to disable the cache on the queries for the mockserver. | ||
* | ||
* @param _req | ||
* @param res | ||
* @param next | ||
*/ | ||
function disableCache(_req, res, next) { | ||
res.setHeader('Cache-Control', 'private, no-cache, no-store, must-revalidate'); | ||
res.setHeader('Expires', '-1'); | ||
res.setHeader('Pragma', 'no-cache'); | ||
next(); | ||
} | ||
/** | ||
* Escape the path provided for the annotation URL so that they can fit the regex pattern from Router. | ||
@@ -105,3 +92,2 @@ * | ||
const log = (0, logger_1.getLogger)('server:ux-fe-mockserver'); | ||
app.use(disableCache); | ||
const oDataHandlerPromises = newConfig.services.map(async (mockServiceIn) => { | ||
@@ -108,0 +94,0 @@ const mockService = mockServiceIn; |
@@ -28,2 +28,15 @@ "use strict"; | ||
/** | ||
* Small middleware to disable the cache on the queries for the mockserver. | ||
* | ||
* @param _req | ||
* @param res | ||
* @param next | ||
*/ | ||
function disableCache(_req, res, next) { | ||
res.setHeader('Cache-Control', 'private, no-cache, no-store, must-revalidate'); | ||
res.setHeader('Expires', '-1'); | ||
res.setHeader('Pragma', 'no-cache'); | ||
next(); | ||
} | ||
/** | ||
* Creates the sub router containing the odata protocol processing. | ||
@@ -38,2 +51,3 @@ * | ||
const log = (0, logger_1.getLogger)('server:ux-fe-mockserver'); | ||
router.use(disableCache); | ||
router.head('/', (_req, res, next) => { | ||
@@ -40,0 +54,0 @@ addCSRFTokenIfRequested(_req, res); //HEAD use case |
{ | ||
"name": "@sap-ux/fe-mockserver-core", | ||
"version": "1.1.48", | ||
"version": "1.1.49", | ||
"description": "SAP Fiori OData - Fiori elements mock server core", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
432068