Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit a721cfc3cdd7b8a214ace31b568d5d91ed37b870 1 parent 241ec4d
@vinoski vinoski authored
Showing with 3 additions and 2 deletions.
  1. +2 −1  examples/src/server_sent_events.erl
  2. +1 −1  src/yaws_sse.erl
View
3  examples/src/server_sent_events.erl
@@ -38,7 +38,8 @@ out(A) ->
end
end;
_ ->
- {status, 405}
+ [{status, 405},
+ {header, {"Allow", "GET"}}]
end.
init([Arg]) ->
View
2  src/yaws_sse.erl
@@ -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}].
Please sign in to comment.
Something went wrong with that request. Please try again.