-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use AppendHeader for http2 #2387
Conversation
@@ -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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why it was designed to overwrite before? @zyearn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
Issue Number:
Problem Summary:
What is changed and the side effects?
Changed:
Side effects:
Performance effects(性能影响):
Breaking backward compatibility(向后兼容性):
Check List: