fix: same key params are not overwritten to the last defined (#2299)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Anwarul Islam
2022-04-30 19:53:43 +06:00
committed by GitHub
parent 07735994e1
commit 50744136d0
3 changed files with 66 additions and 15 deletions

View File

@@ -132,13 +132,13 @@ export function createRESTNetworkRequestStream(
),
// Assembling params object
TE.bind("params", ({ req }) =>
TE.of(
req.effectiveFinalParams.reduce((acc, { key, value }) => {
return Object.assign(acc, { [key]: value })
}, {})
)
),
TE.bind("params", ({ req }) => {
const params = new URLSearchParams()
req.effectiveFinalParams.forEach((x) => {
params.append(x.key, x.value)
})
return TE.of(params)
}),
// Keeping the backup start time
TE.bind("backupTimeStart", () => TE.of(Date.now())),