phoenixframework / phoenix_live_reload

Provides live-reload functionality for Phoenix
MIT License
315 stars 90 forks source link

Skip live reload when `resp_body` is nil #63

Closed davishmcclurg closed 7 years ago

davishmcclurg commented 7 years ago

Using send_file with html is causing errors:

** (ArgumentError) argument error
    :erlang.iolist_to_binary(nil)
    (phoenix_live_reload) lib/phoenix_live_reload/live_reloader.ex:95: anonymous fn/2 in Phoenix.LiveReloader.before_send_inject_reloader/2
    (elixir) lib/enum.ex:1811: Enum."-reduce/3-lists^foldl/2-0-"/3
    (plug) lib/plug/conn.ex:1133: Plug.Conn.run_before_send/2
    (plug) lib/plug/conn.ex:432: Plug.Conn.send_file/5
josevalim commented 7 years ago

:heart: :green_heart: :blue_heart: :yellow_heart: :purple_heart: