fix getUserImg con path relativo/assoluto

This commit is contained in:
Samuele E. Locatelli
2020-11-04 12:33:04 +01:00
parent ad40771b4b
commit 19b0f10ed4
+11 -1
View File
@@ -919,7 +919,17 @@ namespace MConnectSDK
try
{
string imgEncoded = Uri.EscapeDataString(imagePath);
string fullImgPath = pageURL + imgEncoded + "?alt=media";
string fullImgPath = "";
// se ho imagePath che inizia per http --> assoluto, altrimenti faccio un inserimento PRE della pageURL
if (imgEncoded.StartsWith("http"))
{
fullImgPath = imgEncoded + "?alt=media";
}
else
{
fullImgPath = pageURL + imgEncoded + "?alt=media";
}
using (Stream response = await cHttpClient.GetStreamAsync(fullImgPath).ConfigureAwait(false))
{
//if()