mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
6b2e5e07cc
Adds two regression tests that lock in the intentional asymmetry between full-URL and non-full-URL modes: - Full-URL mode: opaque base path (e.g. `https://relay.example/custom/v1beta`) is preserved verbatim. Already covered by `preserves_opaque_full_url_with_bare_v1beta_suffix`. - Non-full-URL mode: base path MUST strip `/v1`, `/v1beta`, etc. so the standard `/v1beta/models/{model}:method` endpoint can be appended without producing a doubled `/v1beta/v1beta/models/...` path. The non-full-URL contract is "base URL + cc-switch appends the canonical Gemini endpoint". A user who needs a relay's custom namespace (e.g. `/v1/models/...`) must use full-URL mode and paste the complete method path. This commit adds regression coverage so a future attempt to mirror full-URL's host-whitelist gating into `normalize_gemini_base_path` will fail the test suite immediately.