Skip to content

Commit

Permalink
fix: only handle body in case it is not null
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmpinto committed Oct 30, 2024
1 parent 3bb14d7 commit 1a2b2b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/next-on-fleek/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleek-platform/next-on-fleek",
"version": "1.15.1",
"version": "1.15.2",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/src/index.d.ts",
Expand Down
9 changes: 5 additions & 4 deletions packages/next-on-fleek/templates/_worker.js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ async function adaptFleekRequestToFetch(
return new Request(url, {
method: fleekRequest.method,
headers: fleekRequest.headers,
body:
typeof fleekRequest.body === 'object'
? JSON.stringify(fleekRequest.body)
: fleekRequest.body,
body: !fleekRequest.body
? null
: typeof fleekRequest.body === 'object'
? JSON.stringify(fleekRequest.body)
: fleekRequest.body,
});
}

Expand Down

0 comments on commit 1a2b2b8

Please sign in to comment.