-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
http: stream error on invalid HTTP messaging for HTTP/1 #11884
Changes from 42 commits
ee7cb0d
b04b98e
46768be
d1bf85d
2d7e93d
86031f0
397e369
c139ff1
2d6cac8
d30e854
aa421fd
9718246
cc33ccf
cab6751
00814d2
7f61bdf
908bdfc
e5239e8
4b2f72a
922bb6f
9dec35a
5fb9be3
83cbadf
c9c55bc
a31323f
354c08b
07c3ee5
5e1b95e
eec3bb2
f1787af
2fe6fbc
447b719
c1d456a
025dbc4
30154d7
f99724d
a35bada
b037f64
16414a0
4bb2a86
1410972
5e63612
85e57c4
3dd2c3d
464a5c7
e663b45
d92640d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -414,6 +414,25 @@ Utility::parseHttp1Settings(const envoy::config::core::v3::Http1ProtocolOptions& | |||||
return ret; | ||||||
} | ||||||
|
||||||
Http1Settings | ||||||
Utility::parseHttp1Settings(const envoy::config::core::v3::Http1ProtocolOptions& config, | ||||||
bool hcm_stream_error_set, | ||||||
const Protobuf::BoolValue& hcm_stream_error) { | ||||||
Http1Settings ret = parseHttp1Settings(config); | ||||||
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. I think this function just return the override_stream_error if set, and if not returns the HCM value no? 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. Hm, isn't it the case that when this function is called the HCM value hasn't been initialised to its default value yet (in case of no explicit configuration)? See envoy/source/extensions/filters/network/http_connection_manager/config.cc Lines 233 to 234 in c555587
I guess we could move that initialisation so that it happens earlier, and then simplify this function as per your comment. WDYT? 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. ah, I see what your concern is, but I believe (and you can unit test) that the default value for BoolValue is false, and the default for stream_error_on_invalid_http_messaging_ is false, so you should just be able to set the default to config.override_stream_error_on_invalid_http_message().value() even if it's not set. |
||||||
|
||||||
if (config.has_override_stream_error_on_invalid_http_message()) { | ||||||
// override_stream_error_on_invalid_http_message, if set, takes precedence over any HCM | ||||||
// stream_error_on_invalid_http_message | ||||||
ret.stream_error_on_invalid_http_message_ = | ||||||
config.override_stream_error_on_invalid_http_message().value(); | ||||||
} else if (hcm_stream_error_set) { | ||||||
// HCM, if set, overrides override_stream_error_on_invalid_http_message | ||||||
ret.stream_error_on_invalid_http_message_ = hcm_stream_error.value(); | ||||||
} | ||||||
|
||||||
return ret; | ||||||
} | ||||||
|
||||||
void Utility::sendLocalReply(const bool& is_reset, StreamDecoderFilterCallbacks& callbacks, | ||||||
const LocalReplyData& local_reply_data) { | ||||||
sendLocalReply( | ||||||
|
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.
What does nullopt mean in this context?
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.
It would mean that the new HTTP/1.1 config
stream_error_on_invalid_http_message
hasn't been set, indicating that we need to fall back to the HCM behaviour.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.
OK makes sense can you clarify the comment? Also what does this mean in the case of upstream since there is no HCM?