0

Add perlcritic, fix cpanfile syntax, add Plack::Util

This commit is contained in:
eleksir
2021-06-03 15:09:32 +03:00
parent 5b8962b70d
commit 5f9f534a5d
7 changed files with 133 additions and 8 deletions

View File

@@ -36,11 +36,11 @@ sub joyproxy ($) {
if (defined $readlen) {
if ($readlen != $filesize) {
warn "Unable to read $file readlen does not match filesize: $readlen vs $filesize";
carp "Unable to read $file readlen does not match filesize: $readlen vs $filesize";
return ('500', 'text/plain', "Unable to read file in temporary location\n");
}
} else {
warn "Unable to read $file: $!";
carp "Unable to read $file: $!";
return ('500', 'text/plain', "Unable to read file in temporary location: $!\n");
}
@@ -130,7 +130,7 @@ sub __dlfunc($) {
my $url = shift;
unless (-d '/tmp/joyproxy') {
warn 'no /tmp/joyproxy';
carp 'no /tmp/joyproxy';
unless (mkdir '/tmp/joyproxy') {
return (undef, undef);
@@ -138,7 +138,7 @@ sub __dlfunc($) {
}
my @explodedurl = split /\//msx, $url;
my $file = $explodedurl[$#explodedurl];
my $file = $explodedurl[$#explodedurl]; ## no critic (Variables::RequireNegativeIndices)
$#explodedurl = -1; undef @explodedurl;
$file = '/tmp/joyproxy/' . $file;
$url = __urlencode ($url);