Skip to content

Commit 7c49c91

Browse files
committed
Fixed review comment
1 parent 0ea166b commit 7c49c91

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ImageSharp.Web/Commands/PresetOnlyQueryCollectionRequestParser.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace SixLabors.ImageSharp.Web.Commands
1717
public class PresetOnlyQueryCollectionRequestParser : IRequestParser
1818
{
1919
private readonly IDictionary<string, IDictionary<string, string>> presets;
20+
public const string QueryKey = "preset";
2021

2122
/// <summary>
2223
/// Initializes a new instance of the <see cref="PresetOnlyQueryCollectionRequestParser"/> class.
@@ -28,7 +29,7 @@ public PresetOnlyQueryCollectionRequestParser(IOptions<PresetOnlyQueryCollection
2829
/// <inheritdoc/>
2930
public IDictionary<string, string> ParseRequestCommands(HttpContext context)
3031
{
31-
if (context.Request.Query.Count == 0)
32+
if (context.Request.Query.Count == 0 || !context.Request.Query.ContainsKey(QueryKey))
3233
{
3334
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
3435
}

0 commit comments

Comments
 (0)