fix: correctly check avatar size

This commit is contained in:
spiral 2021-08-06 21:41:18 -04:00
parent 65cb937e07
commit b8bd53f3c0
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
@ -31,7 +31,7 @@ namespace PluralKit.Bot {
url = TryRewriteCdnUrl(url);
var response = await client.GetAsync(uri);
var response = await client.GetAsync(url);
if (!response.IsSuccessStatusCode) // Check status code
throw Errors.AvatarServerError(response.StatusCode);
if (response.Content.Headers.ContentLength == null) // Check presence of content length