Permalink
Browse files

minor changes to server-sent events

Change yaws_sse to send close connection header by default, and change the
example to return an Allow header if anything other than GET is requested.
  • Loading branch information...
1 parent 241ec4d commit a721cfc3cdd7b8a214ace31b568d5d91ed37b870 @vinoski vinoski committed Jul 6, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 examples/src/server_sent_events.erl
  2. +1 −1 src/yaws_sse.erl
@@ -38,7 +38,8 @@ out(A) ->
end
end;
_ ->
- {status, 405}
+ [{status, 405},
+ {header, {"Allow", "GET"}}]
end.
init([Arg]) ->
View
@@ -19,7 +19,7 @@
headers(StreamPid) ->
[{status, 200},
{header, {"Cache-Control", "no-cache"}},
- {header, {"Connection", "Keep-Alive"}},
+ {header, {connection, "close"}},
{header, {transfer_encoding, erase}},
{streamcontent_from_pid, "text/event-stream", StreamPid}].

0 comments on commit a721cfc

Please sign in to comment.