Skip to content

Commit 2227101

Browse files
authored
shouldAddContentType on HTTPMethod.PATCH (#277)
1 parent 4f2a296 commit 2227101

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/doFetchArgs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default async function doFetchArgs<TData = any>(
5353

5454
const headers = ((): HeadersInit | null => {
5555
const contentType = ((initialOptions.headers || {}) as any)['Content-Type']
56-
const shouldAddContentType = !!contentType || [HTTPMethod.POST, HTTPMethod.PUT].includes(method) && !(body instanceof FormData)
56+
const shouldAddContentType = !!contentType || [HTTPMethod.POST, HTTPMethod.PUT, HTTPMethod.PATCH].includes(method) && !(body instanceof FormData)
5757
const headers: any = { ...initialOptions.headers }
5858
if (shouldAddContentType) {
5959
// default content types http://bit.ly/2N2ovOZ

0 commit comments

Comments
 (0)