Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo-sync-2024-06-04T14:46:57+0800 #33

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.2.0b0] - 2023-7-6
### Added
- Kuscia-envoy init release
- Kuscia-envoy init release
10 changes: 4 additions & 6 deletions kuscia/source/filters/http/kuscia_receiver/receiver_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ Http::FilterHeadersStatus ReceiverFilter::decodeHeaders(Http::RequestHeaderMap&
return Http::FilterHeadersStatus::Continue;
}
if (isPassthroughTraffic(headers)) {
ENVOY_LOG(info, "host {} path {} method {} is passthrough traffic", headers.getHostValue(),
ENVOY_LOG(trace, "host {} path {} method {} is passthrough traffic", headers.getHostValue(),
headers.getPathValue(), headers.getMethodValue());
return Http::FilterHeadersStatus::Continue;
} else {
ENVOY_LOG(info, "host {} path {} method {} is kuscia traffic", headers.getHostValue(),
ENVOY_LOG(trace, "host {} path {} method {} is kuscia traffic", headers.getHostValue(),
headers.getPathValue(), headers.getMethodValue());
}
if (isPollRequest(headers) || isForwardRequest(headers) || isForwardResponse(headers)) {
Expand Down Expand Up @@ -184,12 +184,10 @@ bool ReceiverFilter::isForwardRequest(Http::RequestHeaderMap& headers) {
return false;
}
absl::string_view source = sourceHeader[0]->value().getStringView();

absl::string_view host;
auto hostValue = headers.getHostValue();
absl::string_view host = headers.getHostValue();
// rewrite
bool rewrite = false;
if (absl::StartsWith(hostValue, KusciaCommon::InternalClusterHost)) {
if (absl::StartsWith(host, KusciaCommon::InternalClusterHost)) {
auto kusciaHost = headers.get(KusciaCommon::HeaderKeyKusciaHost);
if (!kusciaHost.empty()) {
host = kusciaHost[0]->value().getStringView();
Expand Down
Loading