Skip to content

Commit d7be692

Browse files
committed
resolves #1070
1 parent 247221a commit d7be692

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/main/src/webhook.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export default class Webhook {
2727
* @throws Will throw an error if the fetch request fails
2828
*/
2929
async set(): Promise<Response> {
30-
const url = new URL(`${this.api.toString()}setWebhook`);
30+
const baseUrl = this.api.toString();
31+
const url = new URL(`${baseUrl}${baseUrl.endsWith('/') ? '' : '/'}setWebhook`);
3132

3233
// Configure webhook parameters
3334
const params = new URLSearchParams({
@@ -52,7 +53,8 @@ export default class Webhook {
5253
* @throws Will throw an error if the fetch request fails
5354
*/
5455
async delete(): Promise<Response> {
55-
const url = new URL(`${this.api.toString()}deleteWebhook`);
56+
const baseUrl = this.api.toString();
57+
const url = new URL(`${baseUrl}${baseUrl.endsWith('/') ? '' : '/'}deleteWebhook`);
5658

5759
try {
5860
return await fetch(url.toString());

0 commit comments

Comments
 (0)