-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
7595 - Be able to add the body's content as field with http_response #7596
7595 - Be able to add the body's content as field with http_response #7596
Conversation
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.
I think we need to include a few checks before we can do this safely.
Make sure the body is valid utf-8. While technically a string field could contain any data, we want to have all strings from Telegraf to be valid utf-8. If the body is not valid utf-8, log an error and report body_read_error.
Add the ability to set a limit on the body size: response_body_max_size = "1KiB"
. Check the influxdb_listener for an example using http.MaxBytesReader. If it is exceeded report a body_read_error and log.
Let's also call the new option: response_body_field = "body"
. Default will be "" which means don't add.
@danielnelson thx for your feedback. I did the corresponding changes however please note that regarding
WDYT of these changes? |
@danielnelson please note that the CI fails because of another test that doesn't seem to be related to those changes |
@danielnelson thx |
closes #7595
Required for all PRs: