Skip to content

Commit b53e03e

Browse files
committed
fix: move global Request reference into isFormOrJsonPostRequest to avoid premature node failures
1 parent 8e50222 commit b53e03e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

http.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ export const contentTypeCategory = (list: ReturnType<typeof categorizeContentTyp
112112
* Compound validation of a request that is method:POST and contains JSON or
113113
* form data.
114114
*/
115-
export const isFormOrJsonPostRequest = coerce(
116-
instance(Request),
117-
method(['POST']),
118-
contentTypeCategory(['json', 'form']),
119-
);
115+
export const isFormOrJsonPostRequest = (value: Request) =>
116+
coerce(
117+
instance(Request),
118+
method(['POST']),
119+
contentTypeCategory(['json', 'form']),
120+
)(value);
120121

121122
/**
122123
* Respond to client with JSON

0 commit comments

Comments
 (0)