mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
refactor(url): remove automatic trailing slash stripping from base URL inputs
- Remove `.replace(/\/+$/, "")` from all base URL handlers in useBaseUrlState.ts - Remove trailing slash stripping in useCodexConfigState.ts - Remove trailing slash normalization in providerConfigUtils.ts setCodexBaseUrl() - Update i18n hints (en/ja/zh) to instruct users to avoid trailing slashes This gives users explicit control over URL format rather than silently modifying input.
This commit is contained in:
@@ -453,7 +453,7 @@ export const setCodexBaseUrl = (
|
||||
// 归一化原文本中的引号(既能匹配,也能输出稳定格式)
|
||||
const normalizedText = normalizeQuotes(configText);
|
||||
|
||||
const normalizedUrl = trimmed.replace(/\s+/g, "").replace(/\/+$/, "");
|
||||
const normalizedUrl = trimmed.replace(/\s+/g, "");
|
||||
const replacementLine = `base_url = "${normalizedUrl}"`;
|
||||
const pattern = /base_url\s*=\s*(["'])([^"']+)\1/;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user