3 * Copyright 2015 gRPC authors.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 #include <grpc/support/log.h>
23 #include "test/core/end2end/end2end_tests.h"
25 const char* get_host_override_string(const char* str,
26 grpc_end2end_test_config config) {
27 if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) {
34 const grpc_slice* get_host_override_slice(const char* str,
35 grpc_end2end_test_config config) {
36 const char* r = get_host_override_string(str, config);
38 static grpc_slice ret;
39 ret = grpc_slice_from_static_string(r);
45 void validate_host_override_string(const char* pattern, grpc_slice str,
46 grpc_end2end_test_config config) {
47 if (config.feature_mask & FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER) {
48 GPR_ASSERT(0 == grpc_slice_str_cmp(str, pattern));