xeronuro
11/19/2012 - 3:35 AM

gistfile1.pl

#!/usr/bin/env perl

use Mojolicious::Lite;
use Test::Mojo;
use Test::More tests => 2;

get '/first' => sub {
    shift->redirect_to('second');
};

get '/second' => sub {
    my $c = shift;
    my $connection = $c->req->headers->connection;
    $c->render_text("Connection : $connection");
};

my $t = Test::Mojo->new->max_redirects(2);

$t->get_ok('/first', { Connection => "Close" })->content_is("Connection : Close");