Skip to content

Commit 92b977c

Browse files
committed
use ||
1 parent 88cba2f commit 92b977c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/kit/src/exports/node/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ function get_raw_body(req, body_size_limit) {
9595
});
9696
}
9797

98-
const can_have_body = ['POST', 'PUT', 'PATCH'];
99-
10098
/**
10199
* @param {{
102100
* request: import('http').IncomingMessage;
@@ -111,9 +109,10 @@ export async function getRequest({ request, base, bodySizeLimit }) {
111109
duplex: 'half',
112110
method: request.method,
113111
headers: /** @type {Record<string, string>} */ (request.headers),
114-
body: can_have_body.includes(request.method ?? '')
115-
? get_raw_body(request, bodySizeLimit)
116-
: undefined
112+
body:
113+
request.method === 'POST' || request.method === 'PUT' || request.method === 'PATCH'
114+
? get_raw_body(request, bodySizeLimit)
115+
: undefined
117116
});
118117
}
119118

0 commit comments

Comments
 (0)