Pick tarpit content by request path
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
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],
|
||||
|
||||
Reference in new issue
Block a user