Skip to content

Commit 86568cd

Browse files
Inject invalid command for testing
1 parent 5eb5119 commit 86568cd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ImageSharp.Web/Middleware/ImageSharpMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public async Task Invoke(HttpContext context)
201201
break;
202202
}
203203

204-
++index;
204+
index++;
205205
}
206206
}
207207

@@ -249,7 +249,7 @@ await this.ProcessRequestAsync(
249249
private void StripUnknownCommands(Dictionary<string, string> commands, int startAtIndex)
250250
{
251251
var keys = new List<string>(commands.Keys);
252-
for (var index = startAtIndex; index < keys.Count; index++)
252+
for (int index = startAtIndex; index < keys.Count; index++)
253253
{
254254
string command = keys[index];
255255
if (!this.knownCommands.Contains(command))

tests/ImageSharp.Web.Tests/Processing/PhysicalFileSystemCacheServerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace SixLabors.ImageSharp.Web.Tests.Processing
1616
public class PhysicalFileSystemCacheServerTests : ServerTestBase<PhysicalFileSystemCacheTestServerFixture>
1717
{
1818
private const int Width = 20;
19-
private static readonly string Command = "?width=" + Width + "&v=" + Guid.NewGuid().ToString();
20-
private static readonly string Command2 = "?width=" + (Width + 1) + "&v=" + Guid.NewGuid().ToString();
19+
private static readonly string Command = "?invalidcommand=qwerty&width=" + Width + "&v=" + Guid.NewGuid().ToString();
20+
private static readonly string Command2 = "?invalidcommand=qwerty&width=" + (Width + 1) + "&v=" + Guid.NewGuid().ToString();
2121

2222
public PhysicalFileSystemCacheServerTests(PhysicalFileSystemCacheTestServerFixture fixture)
2323
: base(fixture)

0 commit comments

Comments
 (0)