Skip to content

Document that Plug.Parsers does not reject QUERY without content-type - #1343

Open
agustin2606 wants to merge 1 commit into
elixir-plug:mainfrom
agustin2606:docs/query-content-type
Open

agustin2606 wants to merge 1 commit into
elixir-plug:mainfrom
agustin2606:docs/query-content-type

Conversation

@agustin2606

Copy link
Copy Markdown

Closes #1341

A QUERY request without a content-type header gets an empty :body_params from Plug.Parsers and is not rejected, while RFC 10008 requires the server to fail it. As discussed in the issue, the parser stays as is and the docs now say so.

Changes

  • Added a note to the Plug.Parsers docs: without a content-type the body is not read, Plug.Parsers does not reject such QUERY requests, and applications should check it themselves, with an example plug that responds 415 and halts.

Testing

  • Docs only. Ran the example plug before Plug.Parsers: QUERY without content-type gets 415, with a content-type it is parsed, and other methods are unaffected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plug.Parsers: QUERY without Content-Type is silently accepted with empty body_params (RFC 10008 requires failing the request)

1 participant