Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ewgi_push_stream: was overriding all response headers, fixed now.

  • Loading branch information...
commit 0f87262f3189dfbf73d60b573dd051a61a1216ca 1 parent d0d7018
@davide davide authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/middleware/ewgi_push_stream/ewgi_push_stream.erl
View
7 src/middleware/ewgi_push_stream/ewgi_push_stream.erl
@@ -28,8 +28,9 @@ run(Ctx, [Status, CT, StreamFun]) when is_function(StreamFun, 1) ->
run(Ctx, [Status, CT, StreamPid]);
run(Ctx, [Status, ContentType, StreamPid]) when is_pid(StreamPid) ->
+ Headers = ewgi_api:response_headers(Ctx),
ewgi_api:response_status(Status,
- ewgi_api:response_headers([{"Content-type", ContentType}],
+ ewgi_api:response_headers([{"Content-type", ContentType}|Headers],
ewgi_api:response_message_body(StreamPid, Ctx))).
%%--------------------------------------------------------------------
@@ -57,7 +58,7 @@ stream_function(Generator) ->
end
end.
-non_chunked_stream(Ctx, Connection, 0) ->
+non_chunked_stream(_Ctx, Connection, 0) ->
IoList = ["done"],
ewgi_api:stream_process_deliver(Connection, IoList);
non_chunked_stream(Ctx, Connection, Times) ->
@@ -66,7 +67,7 @@ non_chunked_stream(Ctx, Connection, Times) ->
timer:sleep(2000),
non_chunked_stream(Ctx, Connection, Times - 1).
-chunked_stream(Ctx, Connection, 0) ->
+chunked_stream(_Ctx, Connection, 0) ->
IoList = ["done"],
ewgi_api:stream_process_deliver_final_chunk(Connection, IoList);
chunked_stream(Ctx, Connection, Times) ->
Please sign in to comment.
Something went wrong with that request. Please try again.