Plack/Middleware/Openqq/SelfTalkForbid.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 27 CC 5 SCAR 32.3
CC
5
Cov
0%
call
30.0
BEGIN
2.0
CRAP 25.3
1 package Plack::Middleware::Openqq::SelfTalkForbid;
2 use parent qw(Plack::Middleware);
3 sub call{
4 my($self,$env) = @_;
5 my $client = $self->{client};
6 my %query_string;
7 for my $query_string (split(/&/,$env->{QUERY_STRING} )){
8 my($key,$value) = split /=/,$query_string;
9 $query_string{$key} = $value;
10 }
11 if(defined $query_string{qq}){
12 return ['403',[],[]] if $query_string{qq} eq $client->{qq_database}{user}{qq};
13 }
14 elsif(defined $query_string{uin}){
15 return ['403',[],[]] if $query_string{uin} eq $client->{qq_database}{user}{uin};
16 }
17 my $res = $self->app->($env);
18 return $res;
19 }
20 1;