aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-03-23 14:47:40 -0700
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-03-23 14:47:40 -0700
commit8ce3b1ad89ad1e512710489750804bbae3250e3e (patch)
tree9c67d91ae6c02170005d3ba601671e26beec5325 /test
parent5ce5d825df7f73e39b1400b2700bf1e6a398addd (diff)
parent1824f0519f26b00cb5e95e52ea50c7990223157c (diff)
Merge pull request #5383 from miselin/add_request_parsing
Add HTTP request parsing
Diffstat (limited to 'test')
-rw-r--r--test/core/http/format_request_test.c (renamed from test/core/httpcli/format_request_test.c)36
-rw-r--r--test/core/http/httpcli_test.c (renamed from test/core/httpcli/httpcli_test.c)8
-rw-r--r--test/core/http/httpscli_test.c (renamed from test/core/httpcli/httpscli_test.c)8
-rw-r--r--test/core/http/parser_test.c (renamed from test/core/httpcli/parser_test.c)135
-rwxr-xr-xtest/core/http/test_server.py (renamed from test/core/httpcli/test_server.py)2
-rw-r--r--test/core/security/credentials_test.c25
-rw-r--r--test/core/security/jwt_verifier_test.c10
-rw-r--r--test/core/util/port_posix.c1
-rw-r--r--test/core/util/port_server_client.c8
-rw-r--r--test/core/util/port_windows.c1
10 files changed, 163 insertions, 71 deletions
diff --git a/test/core/httpcli/format_request_test.c b/test/core/http/format_request_test.c
index da850049e2..67dfd24803 100644
--- a/test/core/httpcli/format_request_test.c
+++ b/test/core/http/format_request_test.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
*
*/
-#include "src/core/httpcli/format_request.h"
+#include "src/core/http/format_request.h"
#include <string.h>
@@ -39,15 +39,15 @@
#include "test/core/util/test_config.h"
static void test_format_get_request(void) {
- grpc_httpcli_header hdr = {"x-yz", "abc"};
+ grpc_http_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req;
gpr_slice slice;
memset(&req, 0, sizeof(req));
req.host = "example.com";
- req.path = "/index.html";
- req.hdr_count = 1;
- req.hdrs = &hdr;
+ req.http.path = "/index.html";
+ req.http.hdr_count = 1;
+ req.http.hdrs = &hdr;
slice = grpc_httpcli_format_get_request(&req);
@@ -64,7 +64,7 @@ static void test_format_get_request(void) {
}
static void test_format_post_request(void) {
- grpc_httpcli_header hdr = {"x-yz", "abc"};
+ grpc_http_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req;
gpr_slice slice;
char body_bytes[] = "fake body";
@@ -72,9 +72,9 @@ static void test_format_post_request(void) {
memset(&req, 0, sizeof(req));
req.host = "example.com";
- req.path = "/index.html";
- req.hdr_count = 1;
- req.hdrs = &hdr;
+ req.http.path = "/index.html";
+ req.http.hdr_count = 1;
+ req.http.hdrs = &hdr;
slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);
@@ -94,15 +94,15 @@ static void test_format_post_request(void) {
}
static void test_format_post_request_no_body(void) {
- grpc_httpcli_header hdr = {"x-yz", "abc"};
+ grpc_http_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req;
gpr_slice slice;
memset(&req, 0, sizeof(req));
req.host = "example.com";
- req.path = "/index.html";
- req.hdr_count = 1;
- req.hdrs = &hdr;
+ req.http.path = "/index.html";
+ req.http.hdr_count = 1;
+ req.http.hdrs = &hdr;
slice = grpc_httpcli_format_post_request(&req, NULL, 0);
@@ -119,7 +119,7 @@ static void test_format_post_request_no_body(void) {
}
static void test_format_post_request_content_type_override(void) {
- grpc_httpcli_header hdrs[2];
+ grpc_http_header hdrs[2];
grpc_httpcli_request req;
gpr_slice slice;
char body_bytes[] = "fake%20body";
@@ -131,9 +131,9 @@ static void test_format_post_request_content_type_override(void) {
hdrs[1].value = "application/x-www-form-urlencoded";
memset(&req, 0, sizeof(req));
req.host = "example.com";
- req.path = "/index.html";
- req.hdr_count = 2;
- req.hdrs = hdrs;
+ req.http.path = "/index.html";
+ req.http.hdr_count = 2;
+ req.http.hdrs = hdrs;
slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);
diff --git a/test/core/httpcli/httpcli_test.c b/test/core/http/httpcli_test.c
index fbc5d4abe7..bdb7a02e9b 100644
--- a/test/core/httpcli/httpcli_test.c
+++ b/test/core/http/httpcli_test.c
@@ -31,7 +31,7 @@
*
*/
-#include "src/core/httpcli/httpcli.h"
+#include "src/core/http/httpcli.h"
#include <string.h>
@@ -83,7 +83,7 @@ static void test_get(int port) {
memset(&req, 0, sizeof(req));
req.host = host;
- req.path = "/get";
+ req.http.path = "/get";
req.handshaker = &grpc_httpcli_plaintext;
grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15),
@@ -114,7 +114,7 @@ static void test_post(int port) {
memset(&req, 0, sizeof(req));
req.host = host;
- req.path = "/post";
+ req.http.path = "/post";
req.handshaker = &grpc_httpcli_plaintext;
grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5,
@@ -161,7 +161,7 @@ int main(int argc, char **argv) {
} else {
arg_shift = 1;
gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root);
- gpr_asprintf(&args[1], "%s/../../test/core/httpcli/test_server.py", root);
+ gpr_asprintf(&args[1], "%s/../../test/core/http/test_server.py", root);
}
/* start the server */
diff --git a/test/core/httpcli/httpscli_test.c b/test/core/http/httpscli_test.c
index 04c57db286..21845b6a8e 100644
--- a/test/core/httpcli/httpscli_test.c
+++ b/test/core/http/httpscli_test.c
@@ -31,7 +31,7 @@
*
*/
-#include "src/core/httpcli/httpcli.h"
+#include "src/core/http/httpcli.h"
#include <string.h>
@@ -84,7 +84,7 @@ static void test_get(int port) {
memset(&req, 0, sizeof(req));
req.host = host;
req.ssl_host_override = "foo.test.google.fr";
- req.path = "/get";
+ req.http.path = "/get";
req.handshaker = &grpc_httpcli_ssl;
grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15),
@@ -116,7 +116,7 @@ static void test_post(int port) {
memset(&req, 0, sizeof(req));
req.host = host;
req.ssl_host_override = "foo.test.google.fr";
- req.path = "/post";
+ req.http.path = "/post";
req.handshaker = &grpc_httpcli_ssl;
grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5,
@@ -163,7 +163,7 @@ int main(int argc, char **argv) {
} else {
arg_shift = 1;
gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root);
- gpr_asprintf(&args[1], "%s/../../test/core/httpcli/test_server.py", root);
+ gpr_asprintf(&args[1], "%s/../../test/core/http/test_server.py", root);
}
/* start the server */
diff --git a/test/core/httpcli/parser_test.c b/test/core/http/parser_test.c
index a26ddd2821..338a301534 100644
--- a/test/core/httpcli/parser_test.c
+++ b/test/core/http/parser_test.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
*
*/
-#include "src/core/httpcli/parser.h"
+#include "src/core/http/parser.h"
#include <stdarg.h>
#include <string.h>
@@ -43,9 +43,65 @@
#include "test/core/util/slice_splitter.h"
#include "test/core/util/test_config.h"
+static void test_request_succeeds(grpc_slice_split_mode split_mode,
+ char *request, char *expect_method,
+ grpc_http_version expect_version,
+ char *expect_path, char *expect_body, ...) {
+ grpc_http_parser parser;
+ gpr_slice input_slice = gpr_slice_from_copied_string(request);
+ size_t num_slices;
+ size_t i;
+ gpr_slice *slices;
+ va_list args;
+
+ grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
+ gpr_slice_unref(input_slice);
+
+ grpc_http_parser_init(&parser);
+
+ for (i = 0; i < num_slices; i++) {
+ GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i]));
+ gpr_slice_unref(slices[i]);
+ }
+ GPR_ASSERT(grpc_http_parser_eof(&parser));
+
+ GPR_ASSERT(GRPC_HTTP_REQUEST == parser.type);
+ GPR_ASSERT(0 == strcmp(expect_method, parser.http.request.method));
+ GPR_ASSERT(0 == strcmp(expect_path, parser.http.request.path));
+ GPR_ASSERT(expect_version == parser.http.request.version);
+
+ if (expect_body != NULL) {
+ GPR_ASSERT(strlen(expect_body) == parser.http.request.body_length);
+ GPR_ASSERT(0 == memcmp(expect_body, parser.http.request.body,
+ parser.http.request.body_length));
+ } else {
+ GPR_ASSERT(parser.http.request.body_length == 0);
+ }
+
+ va_start(args, expect_body);
+ i = 0;
+ for (;;) {
+ char *expect_key;
+ char *expect_value;
+ expect_key = va_arg(args, char *);
+ if (!expect_key) break;
+ GPR_ASSERT(i < parser.http.request.hdr_count);
+ expect_value = va_arg(args, char *);
+ GPR_ASSERT(expect_value);
+ GPR_ASSERT(0 == strcmp(expect_key, parser.http.request.hdrs[i].key));
+ GPR_ASSERT(0 == strcmp(expect_value, parser.http.request.hdrs[i].value));
+ i++;
+ }
+ va_end(args);
+ GPR_ASSERT(i == parser.http.request.hdr_count);
+
+ grpc_http_parser_destroy(&parser);
+ gpr_free(slices);
+}
+
static void test_succeeds(grpc_slice_split_mode split_mode, char *response,
int expect_status, char *expect_body, ...) {
- grpc_httpcli_parser parser;
+ grpc_http_parser parser;
gpr_slice input_slice = gpr_slice_from_copied_string(response);
size_t num_slices;
size_t i;
@@ -55,20 +111,22 @@ static void test_succeeds(grpc_slice_split_mode split_mode, char *response,
grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
gpr_slice_unref(input_slice);
- grpc_httpcli_parser_init(&parser);
+ grpc_http_parser_init(&parser);
for (i = 0; i < num_slices; i++) {
- GPR_ASSERT(grpc_httpcli_parser_parse(&parser, slices[i]));
+ GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i]));
gpr_slice_unref(slices[i]);
}
- GPR_ASSERT(grpc_httpcli_parser_eof(&parser));
+ GPR_ASSERT(grpc_http_parser_eof(&parser));
- GPR_ASSERT(expect_status == parser.r.status);
+ GPR_ASSERT(GRPC_HTTP_RESPONSE == parser.type);
+ GPR_ASSERT(expect_status == parser.http.response.status);
if (expect_body != NULL) {
- GPR_ASSERT(strlen(expect_body) == parser.r.body_length);
- GPR_ASSERT(0 == memcmp(expect_body, parser.r.body, parser.r.body_length));
+ GPR_ASSERT(strlen(expect_body) == parser.http.response.body_length);
+ GPR_ASSERT(0 == memcmp(expect_body, parser.http.response.body,
+ parser.http.response.body_length));
} else {
- GPR_ASSERT(parser.r.body_length == 0);
+ GPR_ASSERT(parser.http.response.body_length == 0);
}
va_start(args, expect_body);
@@ -78,22 +136,22 @@ static void test_succeeds(grpc_slice_split_mode split_mode, char *response,
char *expect_value;
expect_key = va_arg(args, char *);
if (!expect_key) break;
- GPR_ASSERT(i < parser.r.hdr_count);
+ GPR_ASSERT(i < parser.http.response.hdr_count);
expect_value = va_arg(args, char *);
GPR_ASSERT(expect_value);
- GPR_ASSERT(0 == strcmp(expect_key, parser.r.hdrs[i].key));
- GPR_ASSERT(0 == strcmp(expect_value, parser.r.hdrs[i].value));
+ GPR_ASSERT(0 == strcmp(expect_key, parser.http.response.hdrs[i].key));
+ GPR_ASSERT(0 == strcmp(expect_value, parser.http.response.hdrs[i].value));
i++;
}
va_end(args);
- GPR_ASSERT(i == parser.r.hdr_count);
+ GPR_ASSERT(i == parser.http.response.hdr_count);
- grpc_httpcli_parser_destroy(&parser);
+ grpc_http_parser_destroy(&parser);
gpr_free(slices);
}
static void test_fails(grpc_slice_split_mode split_mode, char *response) {
- grpc_httpcli_parser parser;
+ grpc_http_parser parser;
gpr_slice input_slice = gpr_slice_from_copied_string(response);
size_t num_slices;
size_t i;
@@ -103,20 +161,20 @@ static void test_fails(grpc_slice_split_mode split_mode, char *response) {
grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
gpr_slice_unref(input_slice);
- grpc_httpcli_parser_init(&parser);
+ grpc_http_parser_init(&parser);
for (i = 0; i < num_slices; i++) {
- if (!done && !grpc_httpcli_parser_parse(&parser, slices[i])) {
+ if (!done && !grpc_http_parser_parse(&parser, slices[i])) {
done = 1;
}
gpr_slice_unref(slices[i]);
}
- if (!done && !grpc_httpcli_parser_eof(&parser)) {
+ if (!done && !grpc_http_parser_eof(&parser)) {
done = 1;
}
GPR_ASSERT(done);
- grpc_httpcli_parser_destroy(&parser);
+ grpc_http_parser_destroy(&parser);
gpr_free(slices);
}
@@ -145,6 +203,32 @@ int main(int argc, char **argv) {
"\r\n"
"hello world!",
200, "hello world!", "xyz", "abc", NULL);
+ test_request_succeeds(split_modes[i],
+ "GET / HTTP/1.0\r\n"
+ "\r\n",
+ "GET", GRPC_HTTP_HTTP10, "/", NULL, NULL);
+ test_request_succeeds(split_modes[i],
+ "GET / HTTP/1.0\r\n"
+ "\r\n"
+ "xyz",
+ "GET", GRPC_HTTP_HTTP10, "/", "xyz", NULL);
+ test_request_succeeds(split_modes[i],
+ "GET / HTTP/1.1\r\n"
+ "\r\n"
+ "xyz",
+ "GET", GRPC_HTTP_HTTP11, "/", "xyz", NULL);
+ test_request_succeeds(split_modes[i],
+ "GET / HTTP/2.0\r\n"
+ "\r\n"
+ "xyz",
+ "GET", GRPC_HTTP_HTTP20, "/", "xyz", NULL);
+ test_request_succeeds(split_modes[i],
+ "GET / HTTP/1.0\r\n"
+ "xyz: abc\r\n"
+ "\r\n"
+ "xyz",
+ "GET", GRPC_HTTP_HTTP10, "/", "xyz", "xyz", "abc",
+ NULL);
test_fails(split_modes[i], "HTTP/1.0\r\n");
test_fails(split_modes[i], "HTTP/1.2\r\n");
test_fails(split_modes[i], "HTTP/1.0 000 XYX\r\n");
@@ -157,10 +241,15 @@ int main(int argc, char **argv) {
" def\r\n"
"\r\n"
"hello world!");
+ test_fails(split_modes[i], "GET\r\n");
+ test_fails(split_modes[i], "GET /\r\n");
+ test_fails(split_modes[i], "GET / HTTP/0.0\r\n");
+ test_fails(split_modes[i], "GET / ____/1.0\r\n");
+ test_fails(split_modes[i], "GET / HTTP/1.2\r\n");
- tmp1 = gpr_malloc(2 * GRPC_HTTPCLI_MAX_HEADER_LENGTH);
- memset(tmp1, 'a', 2 * GRPC_HTTPCLI_MAX_HEADER_LENGTH - 1);
- tmp1[2 * GRPC_HTTPCLI_MAX_HEADER_LENGTH - 1] = 0;
+ tmp1 = gpr_malloc(2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH);
+ memset(tmp1, 'a', 2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1);
+ tmp1[2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1] = 0;
gpr_asprintf(&tmp2, "HTTP/1.0 200 OK\r\nxyz: %s\r\n\r\n", tmp1);
test_fails(split_modes[i], tmp2);
gpr_free(tmp1);
diff --git a/test/core/httpcli/test_server.py b/test/core/http/test_server.py
index dbbf5ceb3c..ecde494cc0 100755
--- a/test/core/httpcli/test_server.py
+++ b/test/core/http/test_server.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python2.7
-# Copyright 2015, Google Inc.
+# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c
index 98133ef5e5..fd9ccbf45d 100644
--- a/test/core/security/credentials_test.c
+++ b/test/core/security/credentials_test.c
@@ -44,7 +44,7 @@
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
-#include "src/core/httpcli/httpcli.h"
+#include "src/core/http/httpcli.h"
#include "src/core/security/json_token.h"
#include "src/core/support/env.h"
#include "src/core/support/tmpfile.h"
@@ -536,12 +536,12 @@ static void validate_compute_engine_http_request(
GPR_ASSERT(request->handshaker != &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "metadata") == 0);
GPR_ASSERT(
- strcmp(request->path,
+ strcmp(request->http.path,
"/computeMetadata/v1/instance/service-accounts/default/token") ==
0);
- GPR_ASSERT(request->hdr_count == 1);
- GPR_ASSERT(strcmp(request->hdrs[0].key, "Metadata-Flavor") == 0);
- GPR_ASSERT(strcmp(request->hdrs[0].value, "Google") == 0);
+ GPR_ASSERT(request->http.hdr_count == 1);
+ GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Metadata-Flavor") == 0);
+ GPR_ASSERT(strcmp(request->http.hdrs[0].value, "Google") == 0);
}
static int compute_engine_httpcli_get_success_override(
@@ -639,11 +639,12 @@ static void validate_refresh_token_http_request(
gpr_free(expected_body);
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, GRPC_GOOGLE_OAUTH2_SERVICE_HOST) == 0);
- GPR_ASSERT(strcmp(request->path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
- GPR_ASSERT(request->hdr_count == 1);
- GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
GPR_ASSERT(
- strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0);
+ strcmp(request->http.path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
+ GPR_ASSERT(request->http.hdr_count == 1);
+ GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
+ GPR_ASSERT(strcmp(request->http.hdrs[0].value,
+ "application/x-www-form-urlencoded") == 0);
}
static int refresh_token_httpcli_post_success(
@@ -898,12 +899,12 @@ static int default_creds_gce_detection_httpcli_get_success_override(
gpr_timespec deadline, grpc_httpcli_response_cb on_response,
void *user_data) {
grpc_httpcli_response response = http_response(200, "");
- grpc_httpcli_header header;
+ grpc_http_header header;
header.key = "Metadata-Flavor";
header.value = "Google";
response.hdr_count = 1;
response.hdrs = &header;
- GPR_ASSERT(strcmp(request->path, "/") == 0);
+ GPR_ASSERT(strcmp(request->http.path, "/") == 0);
GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
on_response(exec_ctx, user_data, &response);
return 1;
@@ -961,7 +962,7 @@ static int default_creds_gce_detection_httpcli_get_failure_override(
void *user_data) {
/* No magic header. */
grpc_httpcli_response response = http_response(200, "");
- GPR_ASSERT(strcmp(request->path, "/") == 0);
+ GPR_ASSERT(strcmp(request->http.path, "/") == 0);
GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
on_response(exec_ctx, user_data, &response);
return 1;
diff --git a/test/core/security/jwt_verifier_test.c b/test/core/security/jwt_verifier_test.c
index f6ec9e12ef..d2f8d1d182 100644
--- a/test/core/security/jwt_verifier_test.c
+++ b/test/core/security/jwt_verifier_test.c
@@ -35,7 +35,7 @@
#include <string.h>
-#include "src/core/httpcli/httpcli.h"
+#include "src/core/http/httpcli.h"
#include "src/core/security/b64.h"
#include "src/core/security/json_token.h"
#include "test/core/util/test_config.h"
@@ -288,7 +288,7 @@ static int httpcli_get_google_keys_for_email(
grpc_httpcli_response response = http_response(200, good_google_email_keys());
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
- GPR_ASSERT(strcmp(request->path,
+ GPR_ASSERT(strcmp(request->http.path,
"/robot/v1/metadata/x509/"
"777-abaslkan11hlb6nmim3bpspl31ud@developer."
"gserviceaccount.com") == 0);
@@ -336,7 +336,7 @@ static int httpcli_get_custom_keys_for_email(
grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "keys.bar.com") == 0);
- GPR_ASSERT(strcmp(request->path, "/jwk/foo@bar.com") == 0);
+ GPR_ASSERT(strcmp(request->http.path, "/jwk/foo@bar.com") == 0);
on_response(exec_ctx, user_data, &response);
gpr_free(response.body);
return 1;
@@ -372,7 +372,7 @@ static int httpcli_get_jwk_set(grpc_exec_ctx *exec_ctx,
grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
- GPR_ASSERT(strcmp(request->path, "/oauth2/v3/certs") == 0);
+ GPR_ASSERT(strcmp(request->http.path, "/oauth2/v3/certs") == 0);
on_response(exec_ctx, user_data, &response);
gpr_free(response.body);
return 1;
@@ -387,7 +387,7 @@ static int httpcli_get_openid_config(grpc_exec_ctx *exec_ctx,
http_response(200, gpr_strdup(good_openid_config));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "accounts.google.com") == 0);
- GPR_ASSERT(strcmp(request->path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0);
+ GPR_ASSERT(strcmp(request->http.path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0);
grpc_httpcli_set_override(httpcli_get_jwk_set,
httpcli_post_should_not_be_called);
on_response(exec_ctx, user_data, &response);
diff --git a/test/core/util/port_posix.c b/test/core/util/port_posix.c
index 5c0b2717cb..d211016267 100644
--- a/test/core/util/port_posix.c
+++ b/test/core/util/port_posix.c
@@ -49,6 +49,7 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/http/httpcli.h"
#include "src/core/support/env.h"
#include "test/core/util/port_server_client.h"
diff --git a/test/core/util/port_server_client.c b/test/core/util/port_server_client.c
index 653ecb2709..c7b9d63109 100644
--- a/test/core/util/port_server_client.c
+++ b/test/core/util/port_server_client.c
@@ -47,7 +47,7 @@
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-#include "src/core/httpcli/httpcli.h"
+#include "src/core/http/httpcli.h"
typedef struct freereq {
gpr_mu *mu;
@@ -91,7 +91,7 @@ void grpc_free_port_using_server(char *server, int port) {
req.host = server;
gpr_asprintf(&path, "/drop/%d", port);
- req.path = path;
+ req.http.path = path;
grpc_httpcli_context_init(&context);
grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req,
@@ -150,7 +150,7 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg,
GPR_TIMESPAN)));
pr->retries++;
req.host = pr->server;
- req.path = "/get";
+ req.http.path = "/get";
grpc_httpcli_get(exec_ctx, pr->ctx, pr->pollset, &req,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server,
pr);
@@ -189,7 +189,7 @@ int grpc_pick_port_using_server(char *server) {
pr.ctx = &context;
req.host = server;
- req.path = "/get";
+ req.http.path = "/get";
grpc_httpcli_context_init(&context);
grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req,
diff --git a/test/core/util/port_windows.c b/test/core/util/port_windows.c
index a810683440..77125dde75 100644
--- a/test/core/util/port_windows.c
+++ b/test/core/util/port_windows.c
@@ -47,6 +47,7 @@
#include <grpc/support/log.h>
#include "src/core/support/env.h"
+#include "src/core/http/httpcli.h"
#include "src/core/iomgr/sockaddr_utils.h"
#include "test/core/util/port_server_client.h"