NAME

Mojolicious::Plugin::HeaderCondition - Header Condition Plugin

SYNOPSIS

    # Mojolicious
    $self->plugin('header_condition');

    # Must match all of these headers
    $self->routes->route('/:controller/:action')->over(headers => {
        X-Secret-Header => 'Foo',
        Referer => qr/^https?:\/\/example\.com\//
    })->to('foo#bar');

    # Mojolicious::Lite
    plugin 'header_condition';
    get '/' => (headers => {'Referer' => qr/^https?:\/\/example\.com\//})
      => sub {...};

DESCRIPTION

Mojolicous::Plugin::HeaderCondition is a routes condition for header based routes.

METHODS

Mojolicious::Plugin::HeaderCondition inherits all methods from Mojolicious::Plugin and implements the following new ones.

register

    $plugin->register;

SEE ALSO

Mojolicious, Mojolicious::Book, http://mojolicious.org.