mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 07:53:34 +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 = [];
|
||||
each(params, (p) => {
|
||||
if (!isEmpty(trim(p.name)) && !isEmpty(trim(p.value))) {
|
||||
queryString.push(`${p.name}=${p.value}`);
|
||||
const hasEmptyName = isEmpty(trim(p.name));
|
||||
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