mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 06:47:56 +00:00
feat(webhooks): verify that url is accessible before saving it
This commit is contained in:
parent
0a244eb9b5
commit
ece17f7470
2 changed files with 15 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ namespace PluralKit.Core
|
|||
_provider = provider;
|
||||
}
|
||||
|
||||
private async Task DoPostRequest(SystemId system, string webhookUrl, HttpContent content)
|
||||
public async Task DoPostRequest(SystemId system, string webhookUrl, HttpContent content, bool isVerify = false)
|
||||
{
|
||||
if (!await DispatchExt.ValidateUri(webhookUrl))
|
||||
{
|
||||
|
|
@ -35,7 +35,10 @@ namespace PluralKit.Core
|
|||
}
|
||||
catch (HttpRequestException e)
|
||||
{
|
||||
_logger.Error("Could not dispatch webhook request!", e);
|
||||
if (isVerify)
|
||||
throw;
|
||||
else
|
||||
_logger.Error("Could not dispatch webhook request!", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue