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

Webhooks list API newline handling (#2287) #2340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonathanNagy
Copy link

What this PR does / why we need it:

Escaped new lines are allowed in the quoted JSON strings in payload for webhooks, but fail to render in the HealthChecks UI interface. An exception is thrown when Regex.Unescape() is called and then JsonNode.Parse() on the results, and literal newlines are included in JSON strings of the payload.

  • Allow for escaped newlines inside double quoted blocks in payload when pulling the list of webhooks from the webhooks API
  • Unit tests for newlines inside and outside quoted JSON strings in payload

Which issue(s) this PR fixes:

Please reference the issue this PR will close: #2287

Special notes for your reviewer:

First time contributing to a open source github project, this submission may be rough. I do not know how to run end-to-end tests.

Does this PR introduce a user-facing change?:

Yes

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Unit tests passing
  • [?] End-to-end tests passing

* Allow for escaped newlines inside double quoted blocks in payload when pulling the list of webhooks from the webhooks API
* Unit tests for newlines inside and outside quoted JSON strings in payload
@JonathanNagy
Copy link
Author

@dotnet-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HealthChecker fails to deserialize a valid JSON string
1 participant