Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure we send 406 errors for unsupported accept types #2046

Open
sentry-io bot opened this issue Apr 30, 2024 · 0 comments
Open

Ensure we send 406 errors for unsupported accept types #2046

sentry-io bot opened this issue Apr 30, 2024 · 0 comments

Comments

@sentry-io
Copy link

sentry-io bot commented Apr 30, 2024

Looks like we have bots etc poking around for things, not sure why this got logged into sentry.

For this class of situation we should gracefully return a 406.

Sentry Issue: LIGHTNING-AK

Phoenix.NotAcceptableError: no supported media type in accept header.

Expected one of ["html"] but got the following formats:

  * "application/dns-json" with extensions: []

To accept custom formats, register them under the :mime library
in your config/config.exs file:

    config :mime, :types, %{
      "application/xml" => ["xml"]
    }

And then run `mix deps.clean --build mime` to force it to be recompiled.

  File "lib/phoenix/controller.ex", line 1606, in Phoenix.Controller.refuse/3
  Module "Elixir.LightningWeb.Router", in LightningWeb.Router.browser/2
  File "lib/lightning_web/router.ex", line 1, in LightningWeb.Router.__pipe_through3__/1
  File "lib/phoenix/router.ex", line 475, in Phoenix.Router.__call__/5
  File "lib/lightning_web/endpoint.ex", line 1, in LightningWeb.Endpoint.plug_builder_call/2
...
(3 additional frame(s) were not displayed)

(Phoenix.NotAcceptableError no supported media type in accept header.

Expected one of ["html"] but got the following formats:

  * "application/dns-json" with extensions: []

To accept custom formats, register them under the :mime library
in your config/config.exs file:

    config :mime, :types, %{
      "application/xml" => ["xml"]
    }

And then run `mix deps.clean --build mime` to force it to be recompiled.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

No branches or pull requests

0 participants