MCPcopy
hub / github.com/scality/cloudserver / _normalizeBackbeatRequest

Function _normalizeBackbeatRequest

lib/routes/routeBackbeat.js:74–85  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

72}
73
74function _normalizeBackbeatRequest(req) {
75 /* eslint-disable no-param-reassign */
76 const parsedUrl = url.parse(req.url, true);
77 req.path = _decodeURI(parsedUrl.pathname);
78 const pathArr = req.path.split('/');
79 req.query = parsedUrl.query;
80 req.resourceType = pathArr[3];
81 req.bucketName = pathArr[4];
82 req.objectKey = pathArr.slice(5).join('/');
83 req.actionImplicitDenies = false;
84 /* eslint-enable no-param-reassign */
85}
86
87function _isObjectRequest(req) {
88 return ['data', 'metadata', 'multiplebackenddata', 'multiplebackendmetadata'].includes(req.resourceType);

Callers 1

routeBackbeatFunction · 0.85

Calls 1

_decodeURIFunction · 0.70

Tested by

no test coverage detected