Skip to content
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

Escape double quotes in all strings, not just top level model strings #20318

Merged
merged 3 commits into from
Aug 31, 2024

Conversation

kingzacko1
Copy link
Contributor

Description

The original fix for escaping double quotes in Custom HTTP Notifications fixed only top level strings in the model map. However, the backlog is a list of MessageSummary objects so the message.message fields were not properly being escaped. These changes add a JsonSafeEngineProvider which escapes all double quotes in String objects whenever they are substituted into a JSON formatted payload. This should handle all strings in the model, not just those that are top-level values.

Motivation and Context

Graylog2/support#69

How Has This Been Tested?

local tests and unit tests

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Copy link
Contributor

@danotorrey danotorrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and tests successfully

@kingzacko1 kingzacko1 merged commit 218ca9e into master Aug 31, 2024
6 checks passed
@kingzacko1 kingzacko1 deleted the fix-backlog-double-quotes-in-custom-http-v2-alerts branch August 31, 2024 01:15
kingzacko1 added a commit that referenced this pull request Aug 31, 2024
…#20318)

* Escape double quotes in all strings, not just top level model strings
kingzacko1 added a commit that referenced this pull request Sep 3, 2024
…#20318) (#20319)

* Escape double quotes in all strings, not just top level model strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants