Skip to content

Instantly share code, notes, and snippets.

@bduggan
Created September 13, 2011 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bduggan/1213890 to your computer and use it in GitHub Desktop.
Save bduggan/1213890 to your computer and use it in GitHub Desktop.
#!/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");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment