修正 new_api 验证测试断言

This commit is contained in:
zhiqicloud
2026-05-20 13:04:22 +08:00
parent 122daf0f87
commit ebc1774300

View File

@@ -1490,7 +1490,24 @@ async fn gateway_verifies_admin_provider_ops_locally_for_new_api_with_trusted_ad
.and_then(|value| value.to_str().ok()), .and_then(|value| value.to_str().ok()),
Some("session=foo") Some("session=foo")
); );
assert!(headers.contains_key("sec-ch-ua")); assert_eq!(
headers
.get(axum::http::header::USER_AGENT)
.and_then(|value| value.to_str().ok()),
Some("cc-switch/1.0")
);
assert_eq!(
headers
.get(axum::http::header::CONTENT_TYPE)
.and_then(|value| value.to_str().ok()),
Some("application/json")
);
assert_eq!(
headers
.get(axum::http::header::ACCEPT)
.and_then(|value| value.to_str().ok()),
Some("application/json")
);
let mut encoder = GzEncoder::new(Vec::new(), Compression::default()); let mut encoder = GzEncoder::new(Vec::new(), Compression::default());
encoder encoder
.write_all( .write_all(