Skip to content

Commit caaeed2

Browse files
committed
Export get_params
1 parent 2887042 commit caaeed2

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

cgi-bin/page.fcgi

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ sub doit
304304
# Check and increment request count
305305
my $request_count = $rate_limit_cache->get($client_ip) || 0;
306306

307+
# TODO: update the vwf_log variable to point here
307308
$vwflog ||= $config->vwflog() || File::Spec->catfile($info->logdir(), 'vwf.log');
308309

309310
# Rate limit by IP
@@ -620,11 +621,11 @@ sub vwflog
620621
'"', $lingua->country(), '",',
621622
'"', $info->browser_type(), '",',
622623
'"', $lingua->language(), '",',
623-
'429,',
624-
'"",',
624+
$info->status(), ',',
625+
'"', $log->template() ? $log->template() : '', '",',
625626
'"', $info->as_string(raw => 1), '",',
626627
'"', $info->warnings_as_string(), '",',
627-
'"$message"',
628+
'"', $message, '"',
628629
"\n";
629630
close($log);
630631
}
@@ -646,7 +647,7 @@ sub vwflog
646647
$log->template() ? $log->template() : '',
647648
$info->as_string(raw => 1),
648649
$info->warnings_as_string(),
649-
'"', $message, '"',
650+
'"', $message, '"'
650651
);
651652
closelog();
652653
}

lib/VWF/Utils.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use warnings;
2020

2121
use Exporter qw(import);
2222

23-
our @EXPORT = qw(create_disc_cache create_memory_cache distance);
23+
our @EXPORT = qw(create_disc_cache create_memory_cache distance get_params);
2424

2525
use CHI;
2626
use Data::Dumper;

tests/get_params

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
use strict;
44
use warnings;
5+
6+
use FindBin qw($Bin);
57
use Test::Most tests => 7;
68
use Error qw(:try);
79

8-
use lib '../lib';
10+
use lib "$Bin/../lib";
911

1012
use_ok('VWF::Utils');
1113

0 commit comments

Comments
 (0)