Skip to content

Commit

Permalink
no charset is an option too
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 17, 2015
1 parent 129e317 commit dfb031b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent/Transactor.pm
Expand Up @@ -151,7 +151,7 @@ sub websocket {

sub _form {
my ($self, $tx, $form, %options) = @_;
$options{charset} //= 'UTF-8';
$options{charset} = 'UTF-8' unless exists $options{charset};

# Check for uploads and force multipart if necessary
my $req = $tx->req;
Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/charset_lite_app.t
Expand Up @@ -56,13 +56,13 @@ $t->post_ok('/' => form => {foo => 'yatta'})->status_is(200)
->content_is('foo: yatta');

# Send raw Shift_JIS octets (like browsers do)
$t->post_ok('/' => form => {foo => $yatta_sjis} => charset => '')
$t->post_ok('/' => form => {foo => $yatta_sjis} => charset => undef)
->status_is(200)->content_type_unlike(qr/application/)
->content_type_like(qr/Shift_JIS/)->content_like(qr/$yatta/);

# Send raw Shift_JIS octets (like browsers do, multipart message)
$t->post_ok('/' => {'Content-Type' => 'multipart/form-data'} => form =>
{foo => $yatta_sjis} => charset => '')->status_is(200)
{foo => $yatta_sjis} => charset => undef)->status_is(200)
->content_type_like(qr/Shift_JIS/)->content_like(qr/$yatta/);

# Send as string
Expand Down

0 comments on commit dfb031b

Please sign in to comment.