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

Create uri with URL object #1677

Merged
merged 6 commits into from
Jul 24, 2019
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/botkit-plugin-cms/src/cms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

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

/**
Expand Down Expand Up @@ -70,7 +71,7 @@ export class BotkitCMSHelper {

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