Content-type for custom binary format

Hi, I am trying to use a custom binary format with phoenix. I registered my custom mime type and an encoder in my config.exs file:

config :mime, :types, %{
  "application/bmpa" => ["bmap"]

config :phoenix_template, :format_encoders, 
  bmap: BMAP.Encoder 

And added the the accepts plug to my pipeline:

plug :accepts, [:bmap]

Everything seems to be working great, except that for some reason “charset=utf-8” is added to the response content type header. As far as I understand this does not make much sense in this case because it’s a custom binary encoding and not utf8.

How can I keep phoenix from adding this charset to the content type?

Seems like the only way to prevent that is to manually set the content-type header:

1 Like