Repository navigation
SubstitutionFormatUtils can log multiple occurrences of same header - #46688
Conversation
|
Hi @akamathdev, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
| std::optional<size_t> max_length) | ||
| : main_header_(main_header), alternative_header_(alternative_header), max_length_(max_length) {} | ||
| std::optional<size_t> max_length, | ||
| std::optional<bool> multi_value) |
There was a problem hiding this comment.
I am looking for early feedback on the approach before spending more effort on this. There are likely more places the issue is asking to change as well that I need to consider
|
@akamathdev could you fix DCO please |
8ce3099 to
e284a68
Compare
Existing format specifiers will only emit the first occurrence of a header. Introduce new format specifiers that allow to print all occurrences of a given header both in the request and response. Signed-off-by: Aditya Kamath <[email protected]>
e284a68 to
3bdb394
Compare
Signed-off-by: Aditya Kamath <[email protected]>
|
@phlax DCO has been fixed |
yanavlasov
left a comment
There was a problem hiding this comment.
The approach looks good to me.
/wait
| absl::string_view alternative_header, | ||
| std::optional<size_t> max_length) | ||
| : main_header_(main_header), alternative_header_(alternative_header), max_length_(max_length) {} | ||
| std::optional<size_t> max_length, std::optional<bool> multi_value) |
There was a problem hiding this comment.
Do you need the multi_value to be optional?
There was a problem hiding this comment.
I initially expected this class to be used elsewhere and was going to make a separate constructor without the new field, but since that didn't turn out to be the case, yes it doesn't have to be optional
Add test for new format specifiers Signed-off-by: Aditya Kamath <[email protected]>
|
LGTM. Sorry for the delay. |
|
Oh, almost forgot. Please add the new substitution formatters to the doc. /wait |
Signed-off-by: Aditya Kamath <[email protected]>
|
@yanavlasov Thank you for the callout. I have updated the substitution formatter docs as well as added a new file to the |
| HTTP | ||
| An HTTP request header where ``X`` is the main HTTP header, ``Y`` is the alternative one, and ``Z`` is an | ||
| optional parameter denoting string truncation up to ``Z`` characters long. The value is taken from | ||
| the HTTP request header named ``X`` first and if it's not set, then request header ``Y`` is used. Only the |
There was a problem hiding this comment.
The diff is weird, but the primary change is the addition of this sentence
Only the first occurrence of the header is logged.
|
Will get to the build issues in a day or two |
Signed-off-by: Aditya Kamath <[email protected]>
|
@yanavlasov Looks like the CI doesn't run until you approve and I am unable to run the test causing the build failure locally, do you have tips on getting around this so I can be confident of the fix before asking for your approval again ? |
Signed-off-by: yanavlasov <[email protected]>
|
Sorry, I have missed this one. Merged main and started CI. |
|
I've merged main, but it now has build errors. /wait |
Signed-off-by: Aditya Kamath <[email protected]>
|
@yanavlasov could you please trigger the build again please |
Signed-off-by: yanavlasov <[email protected]>
|
/retest |
|
/retest |
|
@akamathdev sorry for the delay. The CI seems to be stuck and I'm unable to get it unstuck. Can you please merge main to re-start CI please? /wait |
|
Thanks @yanavlasov for taking care of this. |
Commit Message: SubstitutionFormatUtils can log multiple occurrences of same header
Additional Description:
Existing format specifiers will only emit the first occurrence of a header. Introduce new format specifiers (
REQ_MULTI,REQUEST_HEADER_MULTI,RESP_MULTI,RESPONSE_HEADER_MULTI) that allow to print all occurrences of a given header both in the request and response.Risk Level: Low
Testing:
Manual testing done locally. Added tests that cover the new substitution commands.
Docs Changes: Updated substitution formatter docs to add the new commands that this PR adds.
Release Notes: Added a file to the
changelogsdirectory with a summary.Platform Specific Features:
Attempt at #13454