Skip to content

Commit f800d42

Browse files
committed
Url decode path before fetching from file system
1 parent 20fbfae commit f800d42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ImageSharp.Web/Providers/FileProviderImageProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache License, Version 2.0.
33

44
using System;
5+
using System.Net;
56
using System.Threading.Tasks;
67
using Microsoft.AspNetCore.Http;
78
using Microsoft.AspNetCore.Http.Extensions;
@@ -54,7 +55,7 @@ public virtual bool IsValidRequest(HttpContext context)
5455
/// <inheritdoc/>
5556
public Task<IImageResolver> GetAsync(HttpContext context)
5657
{
57-
IFileInfo fileInfo = this.fileProvider.GetFileInfo(context.Request.Path);
58+
IFileInfo fileInfo = this.fileProvider.GetFileInfo(WebUtility.UrlDecode(context.Request.Path));
5859
if (!fileInfo.Exists)
5960
{
6061
return Task.FromResult<IImageResolver>(null);

0 commit comments

Comments
 (0)