fix(webhooks): actually correctly parse urls for DNS resolution

This commit is contained in:
spiral 2021-11-03 02:02:07 -04:00
parent a81ffc3399
commit 00b7f76a5b
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -76,13 +76,15 @@ namespace PluralKit.Core
return o; return o;
} }
public static async Task<bool> ValidateUri(string uri) public static async Task<bool> ValidateUri(string url)
{ {
var uri = new Uri(url);
IPHostEntry host = null; IPHostEntry host = null;
try try
{ {
host = await Dns.GetHostEntryAsync(uri); host = await Dns.GetHostEntryAsync(uri.DnsSafeHost);
} }
catch (Exception) { } catch (Exception) { }