mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-21 23:43:15 +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}`;
|
uri = `http://${uri}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let paths;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
uri = new URL(uri);
|
uri = new URL(uri);
|
||||||
|
paths = uri.pathname.split('/');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// URL is non-parsable, is it incomplete? Ignore.
|
paths = uri.split('/');
|
||||||
return [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let paths = uri.pathname.split('/');
|
|
||||||
|
|
||||||
paths = paths.reduce((acc, path) => {
|
paths = paths.reduce((acc, path) => {
|
||||||
if (path !== '' && path[0] === ':') {
|
if (path !== '' && path[0] === ':') {
|
||||||
let name = path.slice(1, path.length);
|
let name = path.slice(1, path.length);
|
||||||
@ -63,7 +63,6 @@ export const parsePathParams = (url) => {
|
|||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return paths;
|
return paths;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user