From 4f8f5819e869663ab706aa889113083899393107 Mon Sep 17 00:00:00 2001 From: George Cheng Date: Sat, 27 Jun 2020 11:12:22 +0000 Subject: [PATCH] shouldAddContentType on HTTPMethod.PUT --- src/doFetchArgs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doFetchArgs.ts b/src/doFetchArgs.ts index 02c08bf1..3f022235 100644 --- a/src/doFetchArgs.ts +++ b/src/doFetchArgs.ts @@ -53,7 +53,7 @@ export default async function doFetchArgs( const headers = ((): HeadersInit | null => { const contentType = ((initialOptions.headers || {}) as any)['Content-Type'] - const shouldAddContentType = !!contentType || [HTTPMethod.POST, HTTPMethod.PUT].includes(method) && !(body instanceof FormData) + const shouldAddContentType = !!contentType || [HTTPMethod.POST, HTTPMethod.PUT, HTTPMethod.PATCH].includes(method) && !(body instanceof FormData) const headers: any = { ...initialOptions.headers } if (shouldAddContentType) { // default content types http://bit.ly/2N2ovOZ