File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ export default class Webhook {
27
27
* @throws Will throw an error if the fetch request fails
28
28
*/
29
29
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` ) ;
31
32
32
33
// Configure webhook parameters
33
34
const params = new URLSearchParams ( {
@@ -52,7 +53,8 @@ export default class Webhook {
52
53
* @throws Will throw an error if the fetch request fails
53
54
*/
54
55
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` ) ;
56
58
57
59
try {
58
60
return await fetch ( url . toString ( ) ) ;
You can’t perform that action at this time.
0 commit comments