Skip to content

Commit

Permalink
fixed metro.request.with() when you've added a body to the request ea…
Browse files Browse the repository at this point in the history
…rlier, it now keeps it.
  • Loading branch information
poef committed Oct 6, 2024
1 parent 7956fc0 commit e42b64e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@muze-nl/metro",
"version": "0.4.0",
"version": "0.4.1",
"description": "http client with middleware support",
"type": "module",
"source": [ "src/browser.mjs", "src/everything.mjs" ],
Expand Down
3 changes: 3 additions & 0 deletions src/metro.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ export function request(...options) {
break
case 'with':
return function(...options) {
if (body) { // body is kept in a seperate value, if it set earlier
options.unshift({ body }) // unshifted so it can be overridden by options
}
return request(target, ...options)
}
break
Expand Down

0 comments on commit e42b64e

Please sign in to comment.