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

Fix HTTP post 2 rule for nested keys + safeguard for non-string headers #823

Merged

Conversation

lepouletsuisse
Copy link
Contributor

Description

  • Fix an issue where using nested keys in the payload break the HTTP Post 2 alerter with a TypeError: Can't compile non template nodes error.
  • Make the Jinja2 templating simpler by stringifying the dict to replace the values, then change it again to a dictionary for the request.
  • Add a safeguard to avoid being able to send nested headers in the request (Headers are always strings)

Checklist

  • I have reviewed the contributing guidelines.
  • I have included unit tests for my changes or additions.
  • I have successfully run make test-docker with my changes.
  • I have manually tested all relevant modes of the change in this PR.
  • I have updated the documentation.
  • I have updated the changelog.

Questions or Comments

I'm the one that created this Alerter, but I forgot to handle nested keys in the payload.

@lepouletsuisse lepouletsuisse force-pushed the fix_httppost2_nested_dictionnary branch from fde76fe to 84b7bb0 Compare April 26, 2022 12:31
Copy link
Owner

@jertel jertel left a comment

Choose a reason for hiding this comment

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

Thanks for the alerter improvements!

@jertel jertel merged commit 27ac39c into jertel:master Apr 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants