Pick tarpit content by request path

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
TomandClaude Sonnet 5.5 committed 2026-11-16 23:00:26 +01:00
1 parent e48b6bb832
commit 13468bbdf9
18 files changed
+307 -9

No files matched your search

+7 -4
View File
@@ -14,9 +14,12 @@ namespace Flypaper.Tests.Http;
public sealed class ContentTypeTests
{
[Theory]
[InlineData("Html", "text/html; charset=utf-8")]
[InlineData("Text", "text/plain; charset=utf-8")]
public async Task Trap_answers_with_the_media_type_of_the_selected_strategy(string content, string expected)
[InlineData("Html", "/", "text/html; charset=utf-8")]
[InlineData("Text", "/", "text/plain; charset=utf-8")]
[InlineData("Html", "/config.json", "application/json")]
[InlineData("Html", "/.env", "text/plain; charset=utf-8")]
[InlineData("Html", "/sitemap.xml", "application/xml")]
public async Task Trap_answers_with_the_media_type_of_the_selected_strategy(string content, string path, string expected)
{
var configuration = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string?>
@@ -39,7 +42,7 @@ public sealed class ContentTypeTests
var context = new DefaultHttpContext { RequestServices = services };
context.Connection.RemoteIpAddress = IPAddress.Parse("203.0.113.9");
context.Connection.LocalPort = 8080;
context.Request.Path = "/";
context.Request.Path = path;
await app.Build()(context);