-
Notifications
You must be signed in to change notification settings - Fork 4.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
make :authority propagate to MD #683
Conversation
@@ -162,7 +173,7 @@ func (d *decodeState) processHeaderField(f hpack.HeaderField) { | |||
case ":path": | |||
d.method = f.Value | |||
default: | |||
if !isReservedHeader(f.Name) { | |||
if !isReservedHeader(f.Name) || isWhitelistedHttp2Header(f.Name) { |
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.
@isn't !isReservedHeader(":authority")
already true?
EDIT: nope, disregard
@iamqizhao thoughts on enabling |
Sounds good to me. I am not sure how comes the test failure. Can you verify if it is from your change? |
@iamqizhao can you help with the errors? This seems to be an error from |
@iamqizhao, did some investigation. Apparently: The reason why the test was failing, was because all the |
Also it seems that if s.sendCompress != "" {
fmt.Printf("Calling send compress!\n")
t.hEnc.WriteField(hpack.HeaderField{Name: "grpc-encoding", Value: s.sendCompress})
} never gets called, hence the filtering of reserved fields fails. |
610f7fb
to
1ef2c52
Compare
@@ -127,6 +127,17 @@ func isReservedHeader(hdr string) bool { | |||
} | |||
} | |||
|
|||
// isWhitelistedHttp2Header checks whether hdr belongs to HTTP2 headers | |||
// that should be propagated into metadata visible to users. | |||
func isWhitelistedHttp2Header(hdr string) bool { |
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.
s/isWhitelistedHttp2Header/isWhitelistedPseudoHeader/
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.
done.
Fixes #457
This is incredibly useful to decide, e.g. on what behaviour to have. E.g. you can enable certain features based on the domain used by the caller.
:authority
is there.:authority
) mid-way, causing the stream to fail. These are now filtered out.