From d30de896f0d1a21c039e1905c0766cc37df06b23 Mon Sep 17 00:00:00 2001 From: Michel Jonathan Schmitz Date: Wed, 13 May 2020 08:47:21 +0200 Subject: [PATCH] feat: add content-type header --- src/client.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client.ts b/src/client.ts index bfd86a85..daabc813 100644 --- a/src/client.ts +++ b/src/client.ts @@ -102,11 +102,12 @@ export class Client { // cut trailing slash if needed this.url = this.url.replace(/\/$/, ''); + this.headers = { + 'Content-Type': 'application/json', + }; + if (typeof version === 'string') { - // set header to tell proxy to select the correct backend - this.headers = { - 'X-StApps-Version': this.version, - }; + this.headers['X-StApps-Version'] = this.version; } }