Bot-Pastebot
view release on metacpan or search on metacpan
lib/Bot/Pastebot/Server/Http.pm view on Meta::CPAN
if ($url =~ m,/paste$,) {
my $content = parse_content($request->content());
if (defined $content->{paste} and length $content->{paste}) {
my $channel = $content->{channel};
defined $channel or $channel = "";
$channel =~ tr[\x00-\x1F\x7F][]d;
my $remote_addr = $heap->{remote_addr};
if ($heap->{my_proxy} && $remote_addr eq $heap->{my_proxy}) {
# apache sets the X-Forwarded-For header to a list of the
# IP addresses that were forwarded from/to
my $forwarded = $request->headers->header('X-Forwarded-For');
if ($forwarded) {
($remote_addr) = $forwarded =~ /([^,\s]+)$/;
}
# else must be local?
}
my $error = "";
if (length $channel) {
# See if it matches.
if (is_ignored($heap->{my_isrv}, $channel, $remote_addr)) {
( run in 0.339 second using v1.01-cache-2.11-cpan-26ccb49234f )