Support new URL response

This commit is contained in:
Jaex 2021-02-27 04:03:58 +03:00
parent 887d8aea29
commit 15229df8ca

View file

@ -60,7 +60,14 @@ public override UploadResult ShortenURL(string url)
if (jsonResponse != null)
{
result.ShortenedURL = URLHelpers.CombineURL("https://zws.im", jsonResponse.Short);
if (!string.IsNullOrEmpty(jsonResponse.URL))
{
result.ShortenedURL = jsonResponse.URL;
}
else
{
result.ShortenedURL = URLHelpers.CombineURL("https://zws.im", jsonResponse.Short);
}
}
}
@ -71,5 +78,6 @@ public override UploadResult ShortenURL(string url)
public class ZeroWidthURLShortenerResponse
{
public string Short { get; set; }
public string URL { get; set; }
}
}