mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 04:37:31 +08:00
fix PluginHttpWrapper 中 Context的回调未代理 . request-block case_sensitive 逻辑错误 (#1146)
This commit is contained in:
@@ -165,7 +165,7 @@ impl HttpContextWrapper<RquestBlockConfig> for RquestBlock {
|
|||||||
}
|
}
|
||||||
let mut request_url = value.unwrap().clone();
|
let mut request_url = value.unwrap().clone();
|
||||||
|
|
||||||
if config.case_sensitive {
|
if !config.case_sensitive {
|
||||||
request_url = request_url.to_lowercase();
|
request_url = request_url.to_lowercase();
|
||||||
}
|
}
|
||||||
for block_exact_url in &config.block_exact_urls {
|
for block_exact_url in &config.block_exact_urls {
|
||||||
@@ -229,7 +229,7 @@ impl HttpContextWrapper<RquestBlockConfig> for RquestBlock {
|
|||||||
return Action::Continue;
|
return Action::Continue;
|
||||||
}
|
}
|
||||||
let mut body = req_body.clone();
|
let mut body = req_body.clone();
|
||||||
if config.case_sensitive {
|
if !config.case_sensitive {
|
||||||
body = body.to_ascii_lowercase();
|
body = body.to_ascii_lowercase();
|
||||||
}
|
}
|
||||||
for block_body in &config.block_bodies {
|
for block_body in &config.block_bodies {
|
||||||
|
|||||||
@@ -82,7 +82,43 @@ impl<PluginConfig> PluginHttpWrapper<PluginConfig> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl<PluginConfig> Context for PluginHttpWrapper<PluginConfig> {}
|
impl<PluginConfig> Context for PluginHttpWrapper<PluginConfig> {
|
||||||
|
fn on_http_call_response(
|
||||||
|
&mut self,
|
||||||
|
token_id: u32,
|
||||||
|
num_headers: usize,
|
||||||
|
body_size: usize,
|
||||||
|
num_trailers: usize,
|
||||||
|
) {
|
||||||
|
self.http_content
|
||||||
|
.on_http_call_response(token_id, num_headers, body_size, num_trailers)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn on_grpc_call_response(&mut self, token_id: u32, status_code: u32, response_size: usize) {
|
||||||
|
self.http_content
|
||||||
|
.on_grpc_call_response(token_id, status_code, response_size)
|
||||||
|
}
|
||||||
|
fn on_grpc_stream_initial_metadata(&mut self, token_id: u32, num_elements: u32) {
|
||||||
|
self.http_content
|
||||||
|
.on_grpc_stream_initial_metadata(token_id, num_elements)
|
||||||
|
}
|
||||||
|
fn on_grpc_stream_message(&mut self, token_id: u32, message_size: usize) {
|
||||||
|
self.http_content
|
||||||
|
.on_grpc_stream_message(token_id, message_size)
|
||||||
|
}
|
||||||
|
fn on_grpc_stream_trailing_metadata(&mut self, token_id: u32, num_elements: u32) {
|
||||||
|
self.http_content
|
||||||
|
.on_grpc_stream_trailing_metadata(token_id, num_elements)
|
||||||
|
}
|
||||||
|
fn on_grpc_stream_close(&mut self, token_id: u32, status_code: u32) {
|
||||||
|
self.http_content
|
||||||
|
.on_grpc_stream_close(token_id, status_code)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn on_done(&mut self) -> bool {
|
||||||
|
self.http_content.on_done()
|
||||||
|
}
|
||||||
|
}
|
||||||
impl<PluginConfig> HttpContext for PluginHttpWrapper<PluginConfig>
|
impl<PluginConfig> HttpContext for PluginHttpWrapper<PluginConfig>
|
||||||
where
|
where
|
||||||
PluginConfig: Default + DeserializeOwned + Clone,
|
PluginConfig: Default + DeserializeOwned + Clone,
|
||||||
|
|||||||
Reference in New Issue
Block a user