Re: [PR] use AppendHeader for http2 (brpc)
Huixxi merged PR #2387: URL: https://github.com/apache/brpc/pull/2387 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [PR] use AppendHeader for http2 (brpc)
zyearn commented on code in PR #2387: URL: https://github.com/apache/brpc/pull/2387#discussion_r1339124802 ## test/brpc_http_rpc_protocol_unittest.cpp: ## @@ -1544,7 +1544,7 @@ TEST_F(HttpTest, http2_header_after_data) { ASSERT_EQ(res_header.content_type(), "application/proto"); // Check overlapped header is overwritten by the latter. const std::string* user_defined1 = res_header.GetHeader("user-defined1"); -ASSERT_EQ(*user_defined1, "overwrite-a"); +ASSERT_EQ(*user_defined1, "a,overwrite-a"); Review Comment: RFC doesn't mention overwritten. It says: Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list [i.e., #(values)]. In brpc implementation, if the incoming header is in the format of "key:value1,value2,value3", brpc won't overwrite cases like this. But combining headers seems reasonable otherwise the previous header would be lost. ## test/brpc_http_rpc_protocol_unittest.cpp: ## @@ -1544,7 +1544,7 @@ TEST_F(HttpTest, http2_header_after_data) { ASSERT_EQ(res_header.content_type(), "application/proto"); // Check overlapped header is overwritten by the latter. const std::string* user_defined1 = res_header.GetHeader("user-defined1"); -ASSERT_EQ(*user_defined1, "overwrite-a"); +ASSERT_EQ(*user_defined1, "a,overwrite-a"); Review Comment: LGTM -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [PR] use AppendHeader for http2 (brpc)
wwbmmm commented on code in PR #2387: URL: https://github.com/apache/brpc/pull/2387#discussion_r1333832158 ## test/brpc_http_rpc_protocol_unittest.cpp: ## @@ -1544,7 +1544,7 @@ TEST_F(HttpTest, http2_header_after_data) { ASSERT_EQ(res_header.content_type(), "application/proto"); // Check overlapped header is overwritten by the latter. const std::string* user_defined1 = res_header.GetHeader("user-defined1"); -ASSERT_EQ(*user_defined1, "overwrite-a"); +ASSERT_EQ(*user_defined1, "a,overwrite-a"); Review Comment: Do you know why it was designed to overwrite before? @zyearn -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [PR] use AppendHeader for http2 (brpc)
lhsoft commented on code in PR #2387: URL: https://github.com/apache/brpc/pull/2387#discussion_r1330925273 ## test/brpc_http_rpc_protocol_unittest.cpp: ## @@ -1544,7 +1544,7 @@ TEST_F(HttpTest, http2_header_after_data) { ASSERT_EQ(res_header.content_type(), "application/proto"); // Check overlapped header is overwritten by the latter. const std::string* user_defined1 = res_header.GetHeader("user-defined1"); -ASSERT_EQ(*user_defined1, "overwrite-a"); +ASSERT_EQ(*user_defined1, "a,overwrite-a"); Review Comment: The test case is `http2_header_after_data`. For http2, according to the [rfc](https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2) , it shouldn't be expected to be overwritten. The [grpc](https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md) use map[string][]string for header: ``` md := metadata.Pairs( "key1", "val1", "key1", "val1-2", // "key1" will have map value []string{"val1", "val1-2"} "key2", "val2", ) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [PR] use AppendHeader for http2 (brpc)
lhsoft commented on code in PR #2387: URL: https://github.com/apache/brpc/pull/2387#discussion_r1330925273 ## test/brpc_http_rpc_protocol_unittest.cpp: ## @@ -1544,7 +1544,7 @@ TEST_F(HttpTest, http2_header_after_data) { ASSERT_EQ(res_header.content_type(), "application/proto"); // Check overlapped header is overwritten by the latter. const std::string* user_defined1 = res_header.GetHeader("user-defined1"); -ASSERT_EQ(*user_defined1, "overwrite-a"); +ASSERT_EQ(*user_defined1, "a,overwrite-a"); Review Comment: The test case is `http2_header_after_data`. For http2, according to the rfc : [ https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2](url), it shouldn't be expected to be overwritten. The [grpc](https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md) use map[string][]string for header: ``` md := metadata.Pairs( "key1", "val1", "key1", "val1-2", // "key1" will have map value []string{"val1", "val1-2"} "key2", "val2", ) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [PR] use AppendHeader for http2 (brpc)
lhsoft commented on code in PR #2387: URL: https://github.com/apache/brpc/pull/2387#discussion_r1330925273 ## test/brpc_http_rpc_protocol_unittest.cpp: ## @@ -1544,7 +1544,7 @@ TEST_F(HttpTest, http2_header_after_data) { ASSERT_EQ(res_header.content_type(), "application/proto"); // Check overlapped header is overwritten by the latter. const std::string* user_defined1 = res_header.GetHeader("user-defined1"); -ASSERT_EQ(*user_defined1, "overwrite-a"); +ASSERT_EQ(*user_defined1, "a,overwrite-a"); Review Comment: The test case is `http2_header_after_data`. For http2, according to the rfc : [ https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2](url), it shouldn't be expected to be overwritten -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org
Re: [PR] use AppendHeader for http2 (brpc)
wwbmmm commented on code in PR #2387: URL: https://github.com/apache/brpc/pull/2387#discussion_r1330049003 ## test/brpc_http_rpc_protocol_unittest.cpp: ## @@ -1544,7 +1544,7 @@ TEST_F(HttpTest, http2_header_after_data) { ASSERT_EQ(res_header.content_type(), "application/proto"); // Check overlapped header is overwritten by the latter. const std::string* user_defined1 = res_header.GetHeader("user-defined1"); -ASSERT_EQ(*user_defined1, "overwrite-a"); +ASSERT_EQ(*user_defined1, "a,overwrite-a"); Review Comment: The original test case was written as "overwrite-a", was it expected to be overwritten? Changing the behavior here may not conform to the previous design. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org