You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a webhook's payload in your appsettings.json configuration file, the library will fail to deserialize it, whereas if you pass the above string to System.Text.Json.JsonSerializer, it will successfully parse it.
After figuring out webhooks this morning, the issue seems to be just in the UI. The actual webhook delivers properly with newlines, but the UI shows "Error fetching webhooks information" on the Webhooks tab.
JonathanNagy
added a commit
to JonathanNagy/AspNetCore.Diagnostics.HealthChecks
that referenced
this issue
Dec 6, 2024
* 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
If you have written the following json string:
For a webhook's payload in your appsettings.json configuration file, the library will fail to deserialize it, whereas if you pass the above string to
System.Text.Json.JsonSerializer
, it will successfully parse it.After debugging, the issue occurs here:
AspNetCore.Diagnostics.HealthChecks/src/HealthChecks.UI/Middleware/UIWebHooksApiMiddleware.cs
Line 34 in 76c1ad2
The
Regex.Unescape
call turns the above into an invalid json string. Why are we escaping exactly?Currently it's impossible to define a new line in the JSON webhook payload object, until the above is somehow addressed.
The exception is thrown when you go to the "Webhooks" section in the UI.
The text was updated successfully, but these errors were encountered: