Skip to content

Commit

Permalink
allow request body for post, put, delete, patch
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Oct 25, 2023
1 parent f7abc7a commit 49f0183
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/remix-dev/vite/node/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ function createRequest(req: IncomingMessage): Request {
let init = {
method: req.method,
headers: createHeaders(req.headers),
// POST, PUT, & PATCH will be read as body by NodeRequest
data: req.method.indexOf("P") === 0 ? req : null,
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
data: ["POST", "PUT", "DELETE", "PATCH"].includes(req.method) ? req : null,
};

return new NodeRequest(url.href, init);
Expand Down

0 comments on commit 49f0183

Please sign in to comment.