diff --git a/config/config.exs b/config/config.exs index 0daae2301..435d81425 100644 --- a/config/config.exs +++ b/config/config.exs @@ -62,7 +62,15 @@ config :logger, config :phoenix, :json_library, Jason config :phoenix, :template_engines, md: PhoenixMarkdown.Engine -config :phoenix_template, :format_encoders, svg: Phoenix.HTML.Engine, xml: Phoenix.HTML.Engine + +config :phoenix_template, :format_encoders, + cast: Jason, + svg: Phoenix.HTML.Engine, + xml: Phoenix.HTML.Engine + +config :mime, :types, %{ + "application/x-asciicast" => ["cast"] +} config :sentry, dsn: "https://public:secret@sentry.io/1", diff --git a/lib/asciinema_web/controllers/fallback_controller.ex b/lib/asciinema_web/controllers/fallback_controller.ex index 9c7f103e1..e2cdac8cf 100644 --- a/lib/asciinema_web/controllers/fallback_controller.ex +++ b/lib/asciinema_web/controllers/fallback_controller.ex @@ -12,6 +12,7 @@ defmodule AsciinemaWeb.FallbackController do |> put_view( html: AsciinemaWeb.ErrorHTML, json: AsciinemaWeb.ErrorJSON, + cast: AsciinemaWeb.ErrorJSON, txt: AsciinemaWeb.ErrorTEXT, svg: AsciinemaWeb.ErrorTEXT, xml: AsciinemaWeb.ErrorTEXT