handle multiple env vars (#3107)

Co-authored-by: ayadav16 <ayadav7@binghamton.edu>
This commit is contained in:
Apoorv Yadav 2024-09-15 15:54:51 -04:00 committed by GitHub
parent 6d239929da
commit 19501812fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,15 +42,15 @@ export const parsePathParams = (url) => {
uri = `http://${uri}`;
}
let paths;
try {
uri = new URL(uri);
paths = uri.pathname.split('/');
} catch (e) {
// URL is non-parsable, is it incomplete? Ignore.
return [];
paths = uri.split('/');
}
let paths = uri.pathname.split('/');
paths = paths.reduce((acc, path) => {
if (path !== '' && path[0] === ':') {
let name = path.slice(1, path.length);
@ -63,7 +63,6 @@ export const parsePathParams = (url) => {
}
return acc;
}, []);
return paths;
};