Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 64e9b36

Browse files
authored
Merge pull request #1677 from adantoscano/fix-uri-cms-plugin
Create uri with URL object
2 parents cf7b3fd + cae2866 commit 64e9b36

File tree

1 file changed

+2
-1
lines changed
  • packages/botkit-plugin-cms/src

1 file changed

+2
-1
lines changed

packages/botkit-plugin-cms/src/cms.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import { Botkit, BotkitDialogWrapper, BotkitMessage, BotWorker, BotkitConversation } from 'botkit';
1010
import * as request from 'request';
11+
const url = require('url');
1112
const debug = require('debug')('botkit:cms');
1213

1314
/**
@@ -70,7 +71,7 @@ export class BotkitCMSHelper {
7071

7172
private async apiRequest(uri: string, params: {[key: string]: any} = {}, method: string = 'GET'): Promise<any> {
7273
let req = {
73-
uri: this._config.uri + uri + '?access_token=' + this._config.token,
74+
uri: url.resolve(this._config.uri, uri + '?access_token=' + this._config.token),
7475
headers: {
7576
'content-type': 'application/json'
7677
},

0 commit comments

Comments
 (0)