mirror of
https://github.com/usebruno/bruno.git
synced 2025-02-16 17:51:48 +01:00
add query param even when value is missing (#1370)
This commit is contained in:
parent
467e63d6fa
commit
0dd8154d8b
@ -33,8 +33,13 @@ export const stringifyQueryParams = (params) => {
|
|||||||
|
|
||||||
let queryString = [];
|
let queryString = [];
|
||||||
each(params, (p) => {
|
each(params, (p) => {
|
||||||
if (!isEmpty(trim(p.name)) && !isEmpty(trim(p.value))) {
|
const hasEmptyName = isEmpty(trim(p.name));
|
||||||
queryString.push(`${p.name}=${p.value}`);
|
const hasEmptyVal = isEmpty(trim(p.value));
|
||||||
|
|
||||||
|
// query param name must be present
|
||||||
|
if (!hasEmptyName) {
|
||||||
|
// if query param value is missing, push only <param-name>, else push <param-name: param-value>
|
||||||
|
queryString.push(hasEmptyVal ? p.name : `${p.name}=${p.value}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user