Skip to content

Commit 977a6f2

Browse files
authored
fix(pairing): ensure TO2 messages have correct content type (#1907)
phoenix sometimes adds charset=utf8 to the content-type, which is not compatible with our clients. manually set it to "application/cbor" to avoid issues altogether Signed-off-by: Francesco Noacco <francesco.noacco@secomind.com>
1 parent 97699cf commit 977a6f2

File tree

1 file changed

+1
-0
lines changed
  • apps/astarte_pairing/lib/astarte_pairing_web/plug

1 file changed

+1
-0
lines changed

apps/astarte_pairing/lib/astarte_pairing_web/plug/setup_fdo.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ defmodule Astarte.PairingWeb.Plug.SetupFDO do
4343
case read_body(conn) do
4444
{:ok, body, conn} ->
4545
conn
46+
|> put_resp_header("content-type", "application/cbor")
4647
|> put_resp_header("message-type", to_string(next_message_id))
4748
|> assign(:message_id, message_id)
4849
|> assign(:cbor_body, body)

0 commit comments

Comments
 (0)