mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-22 23:02:40 +01:00
handle multiple env vars (#3107)
Co-authored-by: ayadav16 <ayadav7@binghamton.edu>
This commit is contained in:
parent
6d239929da
commit
19501812fc
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user