root/lang/perl/Moxy/branches/CC/t/Plugins/RefererCutter.t @ 9895

Revision 9895, 0.7 kB (checked in by tokuhirom, 7 years ago)

RefererCutter? なおした。

Line 
1use strict;
2use warnings;
3use Moxy::Plugin::Filter::RefererCutter;
4use Moxy;
5use HTTP::Request;
6use Test::More tests => 2;
7
8Moxy->load_plugins(qw/Filter::RefererCutter/);
9my $m = Moxy->new(
10    {
11        global => {
12            assets_path => File::Spec->catfile( $FindBin::Bin, '..', 'assets' ),
13            storage => {
14                module    => 'DBM_File',
15                file      => 't/testing.ndbm',
16                dbm_class => 'NDBM_File',
17            },
18        },
19    }
20);
21my $req = HTTP::Request->new();
22$req->header('Referer' => 'http://wassr.jp/');
23$req->header('X-Moe' => 'nishiohirokazu');
24$m->run_hook('request_filter' => { request => $req });
25is $req->header('X-Moe') => 'nishiohirokazu';
26ok !$req->header('Referer');
27
Note: See TracBrowser for help on using the browser.