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 {
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 ( ) ) ;
You can’t perform that action at this time.
0 commit comments