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

@@ -13,6 +13,12 @@ public sealed class ConfiguredStrategySelector(
public ITarpitStrategy? Select(TrapContext context)
{
var candidates = strategies.Where(strategy => strategy.Supports(context.Session.Protocol)).ToList();
if (options.CurrentValue.MatchPath && FileContent.Match(context.Path) is { } profile
&& candidates.FirstOrDefault(strategy => strategy.Name == profile.Name) is { } fileStrategy)
{
return fileStrategy;
}
string[] wanted = options.CurrentValue.Content switch
{
DripContent.Text => [TextDripStrategy.StrategyName],