mirror of
https://github.com/alibaba/higress.git
synced 2026-03-02 07:30:49 +08:00
optimize model router&mapper (#1866)
This commit is contained in:
@@ -44,8 +44,8 @@ static RegisterContextFactory register_ModelRouter(
|
||||
namespace {
|
||||
|
||||
constexpr std::string_view SetDecoderBufferLimitKey =
|
||||
"SetRequestBodyBufferLimit";
|
||||
constexpr std::string_view DefaultMaxBodyBytes = "10485760";
|
||||
"set_decoder_buffer_limit";
|
||||
constexpr std::string_view DefaultMaxBodyBytes = "104857600";
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -137,6 +137,11 @@ FilterHeadersStatus PluginRootContext::onHeader(
|
||||
}
|
||||
bool enable = false;
|
||||
for (const auto& enable_suffix : rule.enable_on_path_suffix_) {
|
||||
// Support wildcard "*" to enable for all paths
|
||||
if (enable_suffix == "*") {
|
||||
enable = true;
|
||||
break;
|
||||
}
|
||||
if (absl::EndsWith({path.c_str(), uri_end}, enable_suffix)) {
|
||||
enable = true;
|
||||
break;
|
||||
@@ -153,6 +158,7 @@ FilterHeadersStatus PluginRootContext::onHeader(
|
||||
}
|
||||
removeRequestHeader(Wasm::Common::Http::Header::ContentLength);
|
||||
setFilterState(SetDecoderBufferLimitKey, DefaultMaxBodyBytes);
|
||||
LOG_INFO(absl::StrCat("SetRequestBodyBufferLimit: ", DefaultMaxBodyBytes));
|
||||
return FilterHeadersStatus::StopIteration;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user