diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-14 14:02:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-14 14:02:04 -0700 |
commit | 125cc780c534b836f5443259991307e88b92ad1e (patch) | |
tree | 101d569b3c22e31361a1283d49cceb6e77b12cbf /actionpack/lib/action_controller/metal | |
parent | 09cfa3fa8a910a24c686572fe5d7da2fac155a6f (diff) | |
parent | 7a84f0b33d6827195dd6134a12007992f7795905 (diff) | |
download | rails-125cc780c534b836f5443259991307e88b92ad1e.tar.gz rails-125cc780c534b836f5443259991307e88b92ad1e.tar.bz2 rails-125cc780c534b836f5443259991307e88b92ad1e.zip |
Merge pull request #15070 from ayamomiji/sse-patch
Add multiple lines message support for SSE module
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/live.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/live.rb b/actionpack/lib/action_controller/metal/live.rb index acf40b2e16..4c0554d27b 100644 --- a/actionpack/lib/action_controller/metal/live.rb +++ b/actionpack/lib/action_controller/metal/live.rb @@ -102,7 +102,8 @@ module ActionController end end - @stream.write "data: #{json}\n\n" + message = json.gsub("\n", "\ndata: ") + @stream.write "data: #{message}\n\n" end end |