-
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
Expose fault.http.abort.http_status setting via HTTP header #10294
Merged
Merged
Changes from 3 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
ec89763
Start implementation of HTTP abort header
Augustyniak d9caef6
Fix proto field number
Augustyniak 9b28c7d
Apply patch proposed by tool
Augustyniak 31126b4
Apply patch proposed by the tool
Augustyniak e1cf997
Add missing switch case and method
Augustyniak c534968
lint fixes
Augustyniak 386cf81
Start using abort provider in fault_filter
Augustyniak ec19b1a
Fix formatting
Augustyniak e8657fe
Rename statusCode to status_code
Augustyniak 49042c3
Rename abort_code to abort
Augustyniak 239c406
Add unit test
Augustyniak a63b408
Rename AbortCodeRequest to AbortRequest
Augustyniak d20a624
Add doc string
Augustyniak bd32f55
Update existing fault_filter_test tests
Augustyniak e3c7ca6
Add unit test
Augustyniak 3cd511b
Fix format
Augustyniak a43c6ef
Update header faults integration test
Augustyniak 17ed854
Update existing unit tests
Augustyniak 559465e
Use a different HTTP header name
Augustyniak 93a6332
Update documentation
Augustyniak 3483611
Fix test
Augustyniak 28e4cf8
Fix header name
Augustyniak ac46ced
Use strongly typed Http::Code instead of int
Augustyniak 58e21f7
Update unit test
Augustyniak 97ab5b3
Update tests
Augustyniak 18f9152
format fix
Augustyniak f337341
Fix docs
Augustyniak 224fa21
http -> HTTP doc strings update
Augustyniak 109531e
Update autogenerated files
Augustyniak 4ba49b7
status_code -> statusCode rename
Augustyniak 08ecf36
Performance optimalizations
Augustyniak 2228f5f
Update docs
Augustyniak 60abf18
add unit tests and use &&
Augustyniak 87c61e8
Reorder
Augustyniak 7db79dc
Better doc strings
Augustyniak 0c21567
:hammer:
Augustyniak deec559
Add integration test
Augustyniak 5d62ece
Add const
Augustyniak 1c1420f
Update docs
Augustyniak e647685
Fix docs
Augustyniak 95941c0
fix focs
Augustyniak 26651ab
Fix docs
Augustyniak 651ba63
:hammer:
Augustyniak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,17 +27,22 @@ FaultAbortConfig::FaultAbortConfig( | |
} | ||
|
||
absl::optional<Http::Code> | ||
FaultAbortConfig::HeaderAbortProvider::status_code(const Http::HeaderEntry* header) const { | ||
FaultAbortConfig::HeaderAbortProvider::statusCode(const Http::HeaderEntry* header) const { | ||
absl::optional<Http::Code> ret; | ||
if (header == nullptr) { | ||
return absl::nullopt; | ||
return ret; | ||
} | ||
|
||
uint64_t value; | ||
if (!absl::SimpleAtoi(header->value().getStringView(), &value)) { | ||
return absl::nullopt; | ||
uint64_t code; | ||
if (!absl::SimpleAtoi(header->value().getStringView(), &code)) { | ||
return ret; | ||
} | ||
|
||
if (code >= 200 and code < 600) { | ||
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. nit: s/and/&& (some C++ compilers don't support it and it's not widely used), also please add some out of range tests. |
||
ret = static_cast<Http::Code>(code); | ||
} | ||
|
||
return static_cast<Http::Code>(value); | ||
return ret; | ||
} | ||
|
||
FaultDelayConfig::FaultDelayConfig( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Worth pointing out that
header_abort
needs to be set (and including an RST link back to it).