Skip to content

Commit aa5a594

Browse files
Use Uri class to combine store location with thumb path in GetThumbUrl
Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/19f059e0-4b1b-4db9-b30b-56e92247bc80 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
1 parent 5c23c74 commit aa5a594

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Business/Grand.Business.Storage/Services/PictureService.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,11 @@ protected virtual async Task<string> GetThumbPhysicalPath(string thumbFileName)
158158
/// <returns>Local picture thumb path</returns>
159159
protected virtual string GetThumbUrl(string thumbFileName, string storeLocation = null)
160160
{
161-
storeLocation = !string.IsNullOrEmpty(storeLocation) ? storeLocation : string.Empty;
162-
return storeLocation.TrimEnd('/') + _mediaFileStore.Combine(ImageThumbPath, thumbFileName);
161+
var thumbPath = _mediaFileStore.Combine(ImageThumbPath, thumbFileName);
162+
if (string.IsNullOrEmpty(storeLocation))
163+
return thumbPath;
164+
165+
return new Uri(new Uri(storeLocation), thumbPath).ToString();
163166
}
164167

165168
/// <summary>

0 commit comments

Comments
 (0)