From a6977551ef4bf8e68ff992adc26e6c91128e34a7 Mon Sep 17 00:00:00 2001 From: Benjamin Cane Date: Sun, 3 Nov 2024 08:08:24 -0700 Subject: [PATCH 1/3] refactor(proto): redefine HTTP headers structure Because who doesn't love a little complexity? --- sdk/http.proto | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sdk/http.proto b/sdk/http.proto index 4a1f2fb..8ce5a46 100644 --- a/sdk/http.proto +++ b/sdk/http.proto @@ -12,7 +12,7 @@ message HTTPClient { string method = 1; // Headers are the HTTP headers to include in the HTTP request. - map headers = 2; + map headers = 2; // URL is the HTTP URL to call. string url = 3; @@ -37,10 +37,19 @@ message HTTPClientResponse { int32 code = 2; // Headers are the HTTP headers returned from the HTTP request. - map headers = 3; + map headers = 3; // Body is the server-supplied HTTP payload data. The server-supplied payload // will be a byte slice. bytes body = 4; } +// Header is a structure used to define HTTP headers for HTTP requests. +// As HTTP headers can have multiple values, this structure is used to define +// the header values. +message Header { + // Value is the HTTP header value to include in requests and responses. + // This field is a repeated field to allow for multiple values + // which is allowed in HTTP headers. + repeated string value = 2; +} From 0264d93ffd3ed5d9f83d7cdeff37b7cfd7c323d0 Mon Sep 17 00:00:00 2001 From: Benjamin Cane Date: Sun, 3 Nov 2024 08:13:32 -0700 Subject: [PATCH 2/3] Update sdk/http.proto Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- sdk/http.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/http.proto b/sdk/http.proto index 8ce5a46..aa375e0 100644 --- a/sdk/http.proto +++ b/sdk/http.proto @@ -51,5 +51,5 @@ message Header { // Value is the HTTP header value to include in requests and responses. // This field is a repeated field to allow for multiple values // which is allowed in HTTP headers. - repeated string value = 2; + repeated string value = 1; } From d00ea133a1043d19b4b9caf1aaea294dbcdbdde2 Mon Sep 17 00:00:00 2001 From: Benjamin Cane Date: Sun, 3 Nov 2024 08:17:12 -0700 Subject: [PATCH 3/3] refactor(proto): pluralize header value field Because even headers like to multiply sometimes. --- sdk/http.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/http.proto b/sdk/http.proto index aa375e0..66a213c 100644 --- a/sdk/http.proto +++ b/sdk/http.proto @@ -51,5 +51,5 @@ message Header { // Value is the HTTP header value to include in requests and responses. // This field is a repeated field to allow for multiple values // which is allowed in HTTP headers. - repeated string value = 1; + repeated string values = 1; }