Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
improved content post-processing recipe
  • Loading branch information
kraih committed Dec 5, 2012
1 parent a94d2e1 commit d14dc30
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.65 2012-12-05
3.65 2012-12-06
- Added is_range method to Mojo::Asset.
- Improved documentation.
- Improved tests.
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojo/Transaction/WebSocket.pm
Expand Up @@ -81,7 +81,7 @@ sub build_frame {

sub client_challenge {
my $self = shift;
return $self->_challenge($self->req->headers->sec_websocket_key) eq
return _challenge($self->req->headers->sec_websocket_key) eq
$self->res->headers->sec_websocket_accept;
}

Expand Down Expand Up @@ -224,7 +224,7 @@ sub server_handshake {
($req_headers->sec_websocket_protocol || '') =~ /^\s*([^,]+)/
and $res_headers->sec_websocket_protocol($1);
$res_headers->sec_websocket_accept(
$self->_challenge($req_headers->sec_websocket_key));
_challenge($req_headers->sec_websocket_key));
}

sub server_read {
Expand Down Expand Up @@ -253,7 +253,7 @@ sub server_write {
return delete $self->{write} // '';
}

sub _challenge { b64_encode(sha1_bytes(($_[1] || '') . GUID), '') }
sub _challenge { b64_encode(sha1_bytes(($_[0] || '') . GUID), '') }

sub _message {
my ($self, $frame) = @_;
Expand Down
7 changes: 4 additions & 3 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -939,9 +939,10 @@ the renderer provides methods to help you with that.

=head2 Post-processing content

While post-processing tasks are generally very easy with the C<after_dispatch>
hook, there are a few things you need to watch out for, such as dynamically
generated content and content that is streamed directly from files.
While post-processing tasks, especially for content generated by the renderer,
are generally very easy with the C<after_dispatch> hook, there are a few
things you need to watch out for, such as dynamically generated content and
content that is streamed directly from files.

use Mojolicious::Lite;
use IO::Compress::Gzip 'gzip';
Expand Down

0 comments on commit d14dc30

Please sign in to comment.