We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Request
isFormOrJsonPostRequest
1 parent 8e50222 commit b53e03eCopy full SHA for b53e03e
http.ts
@@ -112,11 +112,12 @@ export const contentTypeCategory = (list: ReturnType<typeof categorizeContentTyp
112
* Compound validation of a request that is method:POST and contains JSON or
113
* form data.
114
*/
115
-export const isFormOrJsonPostRequest = coerce(
116
- instance(Request),
117
- method(['POST']),
118
- contentTypeCategory(['json', 'form']),
119
-);
+export const isFormOrJsonPostRequest = (value: Request) =>
+ coerce(
+ instance(Request),
+ method(['POST']),
+ contentTypeCategory(['json', 'form']),
120
+ )(value);
121
122
/**
123
* Respond to client with JSON
0 commit comments