Skip to content

Commit

Permalink
tweaked content negotiation example a little
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 2, 2013
1 parent 1c94e5f commit d922b12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -807,9 +807,9 @@ C<after_render>.

# Check if user agent accepts GZip compression
return unless ($self->req->headers->accept_encoding // '') =~ /gzip/i;
$self->res->headers->append(Vary => 'Accept-Encoding');

# Compress content with GZip
$self->res->headers->append(Vary => 'Accept-Encoding');
$self->res->headers->content_encoding('gzip');
gzip $output, \my $compressed;
$$output = $compressed;
Expand Down

0 comments on commit d922b12

Please sign in to comment.