From ac9a0a0a78410ef6c2461672824eabfa8ff7cdaa Mon Sep 17 00:00:00 2001 From: David Kale Date: Tue, 4 Feb 2020 15:40:55 -0500 Subject: [PATCH] Dont send headers manually, http-client automatically will --- src/cacheHttpClient.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/cacheHttpClient.ts b/src/cacheHttpClient.ts index 3901c11..62ae2c1 100644 --- a/src/cacheHttpClient.ts +++ b/src/cacheHttpClient.ts @@ -133,13 +133,9 @@ export async function reserveCache(key: string): Promise { const reserveCacheRequest: ReserveCacheRequest = { key }; - const additionalHeaders = { - "Content-Type": "application/json" - }; const response = await httpClient.postJson( getCacheApiUrl("caches"), - reserveCacheRequest, - additionalHeaders + reserveCacheRequest ); return response?.result?.cacheId ?? -1; } @@ -269,13 +265,9 @@ async function commitCache( filesize: number ): Promise> { const commitCacheRequest: CommitCacheRequest = { size: filesize }; - const additionalHeaders = { - "Content-Type": "application/json" - }; return await httpClient.postJson( getCacheApiUrl(`caches/${cacheId.toString()}`), - commitCacheRequest, - additionalHeaders + commitCacheRequest ); }