Skip to content

Commit

Permalink
show how to disable gzip compression
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 2, 2014
1 parent b43ada2 commit 70f4911
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -680,6 +680,11 @@ L<Mojo::UserAgent::Transactor/"tx">.
$tx->req->cookies({name => 'foo', value => 'bar'});
$ua->start($tx);
# Deactivate gzip compression
my $tx = $ua->build_tx(GET => 'example.com');
$tx->req->headers->remove('Accept-Encoding');
$ua->start($tx);
# Interrupt response by raising an error
my $tx = $ua->build_tx(GET => 'example.com');
$tx->res->on(progress => sub {
Expand Down
2 changes: 1 addition & 1 deletion lib/Test/Mojo.pm
Expand Up @@ -829,7 +829,7 @@ Perform request and check for transport errors.
# Custom WebSocket handshake
my $tx = $t->ua->build_websocket_tx('/foo');
$tx->req->headers->remove('UserAgent');
$tx->req->headers->remove('User-Agent');
$t->request_ok($tx)->message_ok->message_is('bar')->finish_ok;
=head2 reset_session
Expand Down

0 comments on commit 70f4911

Please sign in to comment.