1Mojolicious::Plugin::HeUasdeerrCCoonndtirtiibount(e3d)PMeorjlolDiocciuomuesn:t:aPtliuognin::HeaderCondition(3)
2
3
4
6 Mojolicious::Plugin::HeaderCondition - Header Condition Plugin
7
9 # Mojolicious
10 $self->plugin('header_condition');
11
12 # Must match all of these headers
13 $self->routes->route('/:controller/:action')->over(headers => {
14 X-Secret-Header => 'Foo',
15 Referer => qr/^https?:\/\/example\.com\//
16 })->to('foo#bar');
17
18 # Mojolicious::Lite
19 plugin 'header_condition';
20 get '/' => (headers => {'Referer' => qr/^https?:\/\/example\.com\//})
21 => sub {...};
22
24 Mojolicous::Plugin::HeaderCondition is a routes condition for header
25 based routes.
26
28 Mojolicious::Plugin::HeaderCondition inherits all methods from
29 Mojolicious::Plugin and implements the following new ones.
30
31 "register"
32 $plugin->register;
33
34 Register condition in Mojolicious application.
35
37 Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
38
39
40
41perl v5.12.3 2010-0M8o-j1o2licious::Plugin::HeaderCondition(3)