Skip to content
Permalink
Browse files Browse the repository at this point in the history
Add back in HTTP method override in service control filter (#802)
This is NOT used by ESPv2, but it is needed for CAG temporarily. We can remove once their rollout is complete.

Signed-off-by: Teju Nareddy <nareddyt@google.com>
  • Loading branch information
nareddyt committed Mar 28, 2023
1 parent e956701 commit e98061e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/README.md
Expand Up @@ -12,8 +12,8 @@ When making changes to the config proto files, make sure:
* No breaking changes, the changes should be backward compatible,
* If a breaking change is required, increase config version.

When making changes to Config Manager, make sure the new config is compatible
with older Envoy binaries under the current API version. If it's incompatible,
When making changes to Config Manager, make sure that **older** config generator binaries are compatible
with **newer** Envoy binaries under the current API version. If it's incompatible,
increase the config version.

## Steps to increase config version
Expand Down
8 changes: 8 additions & 0 deletions src/envoy/http/service_control/filter.cc
Expand Up @@ -53,6 +53,14 @@ Envoy::Http::FilterHeadersStatus ServiceControlFilter::decodeHeaders(
return Envoy::Http::FilterHeadersStatus::StopIteration;
}

// TODO(b/273531500): Temporary until CAG rollout is complete.
if (utils::handleHttpMethodOverride(headers)) {
// Update later filters that the HTTP method has changed by clearing the
// route cache.
ENVOY_LOG(debug, "HTTP method override occurred, recalculating route");
decoder_callbacks_->downstreamCallbacks()->clearRouteCache();
}

// Make sure route is calculated
auto route = decoder_callbacks_->route();

Expand Down

0 comments on commit e98061e

Please sign in to comment.