@sap-ux/fe-mockserver-core
Advanced tools
Comparing version 1.1.34 to 1.1.35
@@ -12,2 +12,3 @@ "use strict"; | ||
const odataRequest_1 = __importDefault(require("../request/odataRequest")); | ||
const url_1 = require("url"); | ||
/** | ||
@@ -56,6 +57,11 @@ * Creates the sub router containing the odata protocol processing. | ||
router.use((req, res, next) => { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
const parser = (0, body_parser_1.raw)({ type: '*/*' }); | ||
const tenantId = ((_a = req.originalUrl) === null || _a === void 0 ? void 0 : _a.startsWith('/tenant-')) ? (_b = req.originalUrl) === null || _b === void 0 ? void 0 : _b.split('/')[1] : 'tenant-default'; | ||
req.tenantId = tenantId; | ||
const sapClient = (_c = req.originalUrl) === null || _c === void 0 ? void 0 : _c.includes('sap-client'); | ||
if (sapClient) { | ||
const parsedUrl = new url_1.URL(`http://dummy${req.originalUrl}`); | ||
req.tenantId = `tenant-${parsedUrl.searchParams.get('sap-client')}`; | ||
} | ||
parser(req, res, function () { | ||
@@ -62,0 +68,0 @@ if (req.body === null || |
{ | ||
"name": "@sap-ux/fe-mockserver-core", | ||
"version": "1.1.34", | ||
"version": "1.1.35", | ||
"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
431060
5031