Skip to content

Instantly share code, notes, and snippets.

@sharifulin
Created May 6, 2010 07:00
Show Gist options
  • Save sharifulin/391879 to your computer and use it in GitHub Desktop.
Save sharifulin/391879 to your computer and use it in GitHub Desktop.
Mojolicious bug with parse url
#!/usr/bin/env perl
use lib qw(../mojo/lib);
use Mojolicious::Lite;
use utf8;
plugin(charset => {charset => 'utf-8'});
get '/author/:name' => sub {
my $self = shift;
warn $self->stash('name');
$self->render_text( $self->stash('name') );
};
app->log->level('error');
use Test::More; plan tests => 15;
use Test::Mojo;
my $t = Test::Mojo->new;
$t->get_ok('/author/Курбатов')->status_is(200)->content_is('Курбатов');
# like IE
$t->get_ok('/author/Курбатов%20В.И.')->status_is(200)->content_is('Курбатов В.И.');
$t->get_ok('/author/Курбатов%20В')->status_is(200)->content_is('Курбатов В');
# like Firefox
$t->get_ok('/author/%D0%9A%D1%83%D1%80%D0%B1%D0%B0%D1%82%D0%BE%D0%B2%20%D0%92.%D0%98.')->status_is(200)->content_is('Курбатов В.И.');
$t->get_ok('/author/%D0%9A%D1%83%D1%80%D0%B1%D0%B0%D1%82%D0%BE%D0%B2%20%D0%92')->status_is(200)->content_is('Курбатов В');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment