test: decode URI component

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
This commit is contained in:
Vinayak Kulkarni 2023-01-08 20:59:43 +05:30
parent 8d3704c021
commit 33cb7e82b4
No known key found for this signature in database
GPG key ID: B8C8194CED989C08

View file

@ -150,14 +150,15 @@ const parseCoordinates = (coordinatePair, query, transformer) => {
* @param {Function} transformer Optional transform function.
*/
const extractPathsFromQuery = (query, transformer) => {
const reqPath = decodeURIComponent(query.path);
const paths = [];
// Return an empty list if no paths have been provided
if ('path' in query && !query.path) {
return paths;
}
// Parse paths provided via path query argument
if ('path' in query && PATH_PATTERN.test(query.path)) {
if (query.path.includes('enc:')) {
if ('path' in query && PATH_PATTERN.test(reqPath)) {
if (reqPath.includes('enc:')) {
const splitPaths = query.path.split('|');
const line = splitPaths
.filter(