mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-06-13 23:57:37 +08:00
fix(proxy): restore header filtering and API matcher consistency
- Canonicalize filtered header deny-lists so Cloudflare and CDN headers are still removed - Normalize incomplete API repo paths to stable owner-level matcher output regardless of trailing slash or query - Add regression tests covering header canonicalization and incomplete API repo path parsing
This commit is contained in:
parent
ba3dcf7624
commit
e9e48fcefd
4 changed files with 73 additions and 9 deletions
|
|
@ -151,7 +151,19 @@ func TestMatcher_Compatibility(t *testing.T) {
|
|||
name: "API Repos Path (missing repo)",
|
||||
rawPath: "https://api.github.com/repos/owner",
|
||||
config: cfgWithAuth,
|
||||
expectedUser: "", expectedRepo: "", expectedMatcher: "api",
|
||||
expectedUser: "owner", expectedRepo: "", expectedMatcher: "api",
|
||||
},
|
||||
{
|
||||
name: "API Repos Path (trailing slash)",
|
||||
rawPath: "https://api.github.com/repos/owner/",
|
||||
config: cfgWithAuth,
|
||||
expectedUser: "owner", expectedRepo: "", expectedMatcher: "api",
|
||||
},
|
||||
{
|
||||
name: "API Repos Path (missing repo with query)",
|
||||
rawPath: "https://api.github.com/repos/owner?per_page=1",
|
||||
config: cfgWithAuth,
|
||||
expectedUser: "owner", expectedRepo: "", expectedMatcher: "api",
|
||||
},
|
||||
{
|
||||
name: "API Users Path (exact user)",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue