test: decode URI component
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
This commit is contained in:
parent
8d3704c021
commit
33cb7e82b4
1 changed files with 3 additions and 2 deletions
|
|
@ -150,14 +150,15 @@ const parseCoordinates = (coordinatePair, query, transformer) => {
|
||||||
* @param {Function} transformer Optional transform function.
|
* @param {Function} transformer Optional transform function.
|
||||||
*/
|
*/
|
||||||
const extractPathsFromQuery = (query, transformer) => {
|
const extractPathsFromQuery = (query, transformer) => {
|
||||||
|
const reqPath = decodeURIComponent(query.path);
|
||||||
const paths = [];
|
const paths = [];
|
||||||
// Return an empty list if no paths have been provided
|
// Return an empty list if no paths have been provided
|
||||||
if ('path' in query && !query.path) {
|
if ('path' in query && !query.path) {
|
||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
// Parse paths provided via path query argument
|
// Parse paths provided via path query argument
|
||||||
if ('path' in query && PATH_PATTERN.test(query.path)) {
|
if ('path' in query && PATH_PATTERN.test(reqPath)) {
|
||||||
if (query.path.includes('enc:')) {
|
if (reqPath.includes('enc:')) {
|
||||||
const splitPaths = query.path.split('|');
|
const splitPaths = query.path.split('|');
|
||||||
const line = splitPaths
|
const line = splitPaths
|
||||||
.filter(
|
.filter(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue