统一API Base URL保存与请求时去除末尾斜杠

This commit is contained in:
mtvpls
2026-07-25 10:57:04 +08:00
parent 19f4957160
commit ca798177b9
16 changed files with 191 additions and 46 deletions
+2 -1
View File
@@ -13,6 +13,7 @@ import { getConfig } from './config';
import { db, getStorage } from './db';
import { lockManager } from './lock';
import type { IStorage, Notification } from './types';
import { normalizeApiBaseUrl } from './url';
import { getNotificationClickUrl } from './web-push';
export interface TelegramConfig {
@@ -426,7 +427,7 @@ function isCloudflareEnvironment(): boolean {
}
function normalizeTelegramApiBaseUrl(input?: string | null): string {
const base = (input || 'https://api.telegram.org').trim().replace(/\/+$/, '');
const base = normalizeApiBaseUrl(input || 'https://api.telegram.org');
return base || 'https://api.telegram.org';
}