-
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
switch hdr { | ||
case ":authority", "Authority": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How comes "Authority"? There is no such thing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, I thought this would be needed for http2 Handler implementation, but that required additional code anyway. |
||
return true | ||
default: | ||
return false | ||
} | ||
} | ||
|
||
func (d *decodeState) setErr(err error) { | ||
if d.err == nil { | ||
d.err = err | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. @isn't EDIT: nope, disregard |
||
if f.Name == "user-agent" { | ||
i := strings.LastIndex(f.Value, " ") | ||
if i == -1 { | ||
|
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.