Skip to content

Instantly share code, notes, and snippets.

@TristinDavis
Forked from bduggan/gist:1213890
Created November 19, 2012 03:35
Show Gist options
  • Select an option

  • Save TristinDavis/4108802 to your computer and use it in GitHub Desktop.

Select an option

Save TristinDavis/4108802 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