From 1505b2b9b5bbfe6eddb4db77b500aba835ff3890 Mon Sep 17 00:00:00 2001 From: Iheanyi Ekechukwu Date: Sun, 31 Jul 2022 17:43:21 -0500 Subject: [PATCH] Remove credentials include, convert URL to string when passed in. --- src/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 554e501..9d06be8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -100,14 +100,13 @@ export class Connection { private async postJSON(url: string | URL, body = {}): Promise { const auth = btoa(`${this.credentials.username}:${this.credentials.password}`) - const response = await fetch(url, { + const response = await fetch(url.toString(), { method: 'POST', body: JSON.stringify(body), headers: { 'Content-Type': 'application/json', Authorization: `Basic ${auth}` - }, - credentials: 'include' + } }) if (response.ok) {