mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix: force http1 for tunnel oauth refresh
This commit is contained in:
@@ -11,7 +11,7 @@ use crate::provider_key_auth::provider_key_is_oauth_managed;
|
||||
use aether_admin::provider::quota as admin_provider_quota_pure;
|
||||
use aether_contracts::{
|
||||
ExecutionPlan, ExecutionTimeouts, ProxySnapshot, RequestBody,
|
||||
EXECUTION_REQUEST_FOLLOW_REDIRECTS_HEADER,
|
||||
EXECUTION_REQUEST_FOLLOW_REDIRECTS_HEADER, EXECUTION_REQUEST_HTTP1_ONLY_HEADER,
|
||||
};
|
||||
use aether_data_contracts::repository::provider_catalog::StoredProviderCatalogKey;
|
||||
use base64::{engine::general_purpose::STANDARD, Engine as _};
|
||||
@@ -1262,6 +1262,11 @@ impl AppState {
|
||||
EXECUTION_REQUEST_FOLLOW_REDIRECTS_HEADER.to_string(),
|
||||
"true".to_string(),
|
||||
);
|
||||
} else {
|
||||
headers.insert(
|
||||
EXECUTION_REQUEST_HTTP1_ONLY_HEADER.to_string(),
|
||||
"true".to_string(),
|
||||
);
|
||||
}
|
||||
let plan = ExecutionPlan {
|
||||
request_id: request.request_id.to_string(),
|
||||
@@ -1339,6 +1344,11 @@ impl AppState {
|
||||
.get(EXECUTION_REQUEST_FOLLOW_REDIRECTS_HEADER)
|
||||
.map(String::as_str)
|
||||
.unwrap_or("-"),
|
||||
http1_only = plan
|
||||
.headers
|
||||
.get(EXECUTION_REQUEST_HTTP1_ONLY_HEADER)
|
||||
.map(String::as_str)
|
||||
.unwrap_or("-"),
|
||||
"gateway local oauth execution request prepared"
|
||||
);
|
||||
let result =
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use aether_contracts::{ExecutionPlan, EXECUTION_REQUEST_FOLLOW_REDIRECTS_HEADER};
|
||||
use aether_contracts::{
|
||||
ExecutionPlan, EXECUTION_REQUEST_FOLLOW_REDIRECTS_HEADER, EXECUTION_REQUEST_HTTP1_ONLY_HEADER,
|
||||
};
|
||||
use aether_crypto::{
|
||||
decrypt_python_fernet_ciphertext, encrypt_python_fernet_plaintext, DEVELOPMENT_ENCRYPTION_KEY,
|
||||
};
|
||||
@@ -4707,6 +4709,13 @@ async fn gateway_refreshes_admin_provider_oauth_key_tunnel_proxy_without_follow_
|
||||
.get(EXECUTION_REQUEST_FOLLOW_REDIRECTS_HEADER),
|
||||
None
|
||||
);
|
||||
assert_eq!(
|
||||
refresh_plan
|
||||
.headers
|
||||
.get(EXECUTION_REQUEST_HTTP1_ONLY_HEADER)
|
||||
.map(String::as_str),
|
||||
Some("true")
|
||||
);
|
||||
|
||||
gateway_handle.abort();
|
||||
execution_runtime_handle.abort();
|
||||
|
||||
Reference in New Issue
Block a user