Page MenuHomePhabricator
Paste P84210

(An Untitled Masterwork)
ActivePublic

Authored by Joe on Wed, Oct 22, 5:09 AM.
Tags
None
Referenced Files
F66778149: raw-paste-data.txt
Wed, Oct 22, 5:09 AM
Subscribers
None
# This piece of code should be called for traffic with the correct X-Trusted-Request header
sub rl_known_bots {
# Add a first entry to start the if; this should never match
if ( !req.http.X-Provenance ) {
return;
}
{{ range $bot := ls "/<path>" }}
{{ $key := printf( "/<path>/%s" $bot }}
{{ $data := json( getv( $key ) ) }}
elsif ( req.http.X-Provenance ~ {{ $bot.name }} ) {
if (vsthrottle.is_denied({{ $bot.name}}, {{ $bot.limit }}, 100, 100 ) {
return(synth(403));
}
}
{{ end }}
}

Event Timeline