From 6f7f4c9a82540e3272f6de2cc8ad948ce9dd0cb0 Mon Sep 17 00:00:00 2001 From: Jamie Barton Date: Mon, 1 Jul 2019 15:28:06 +0100 Subject: [PATCH] fix: remove fixed protocol (#137) --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index d2829b2..58be05a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,7 +19,7 @@ export class MoltinClient { this.storage = storage this.fetch = options.fetch ? options.fetch : fetch this.options = { - host: options.host ? options.host : 'api.moltin.com', + host: options.host ? options.host : 'https://api.moltin.com', version: options.version ? options.version : 'v2', ...others } @@ -44,7 +44,7 @@ export class MoltinClient { } } = this - const uri: string = `https://${host}/${version}/${removeLeadingSlash(path)}` + const uri: string = `${host}/${version}/${removeLeadingSlash(path)}` const customHeaders = { ...classHeaders, @@ -112,7 +112,7 @@ export class MoltinClient { throw new Error('You must provide a client_id') } - const uri: string = `https://${host}/oauth/access_token` + const uri: string = `${host}/oauth/access_token` const body: types.AuthBody = { grant_type: client_secret ? 'client_credentials' : 'implicit',