Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
finalize response headers in cookbook recipe
  • Loading branch information
kraih committed Mar 21, 2015
1 parent 5466c63 commit 133c6aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -683,8 +683,9 @@ infrastructure requirements, since it reuses the HTTP protocol for transport.
# Increase inactivity timeout for connection a bit
$c->inactivity_timeout(300);

# Change content type
# Change content type and finalize response headers
$c->res->headers->content_type('text/event-stream');
$c->write;

# Subscribe to "message" event and forward "log" events to browser
my $cb = $c->app->log->on(message => sub {
Expand Down

0 comments on commit 133c6aa

Please sign in to comment.