Let encoders decide whether to encode HttpMethodMetadata or not, instead of removing it. (#28369)

pull/28372/head
Yash Tibrewal 3 years ago committed by GitHub
parent 264c321d83
commit de5f1ae681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/ext/filters/client_channel/client_channel.cc
  2. 2
      src/core/ext/filters/http/server/http_server_filter.cc
  3. 3
      src/core/lib/security/transport/server_auth_filter.cc

@ -2446,6 +2446,8 @@ class ClientChannel::LoadBalancedCall::Metadata
void Encode(GrpcTimeoutMetadata, grpc_millis) {}
void Encode(HttpPathMetadata, const Slice&) {}
void Encode(HttpMethodMetadata,
const typename HttpMethodMetadata::ValueType&) {}
std::vector<std::pair<std::string, std::string>> Take() {
return std::move(out_);

@ -120,7 +120,7 @@ static grpc_error_handle hs_filter_incoming_metadata(grpc_call_element* elem,
grpc_error_handle error = GRPC_ERROR_NONE;
static const char* error_name = "Failed processing incoming headers";
auto method = b->Take(grpc_core::HttpMethodMetadata());
auto method = b->get(grpc_core::HttpMethodMetadata());
if (method.has_value()) {
switch (*method) {
case grpc_core::HttpMethodMetadata::kPost:

@ -108,6 +108,9 @@ class ArrayEncoder {
grpc_core::Slice(Which::Encode(value)));
}
void Encode(grpc_core::HttpMethodMetadata,
const typename grpc_core::HttpMethodMetadata::ValueType&) {}
private:
void Add(grpc_core::Slice key, grpc_core::Slice value) {
if (array_->count == array_->capacity) {

Loading…
Cancel
Save