Skip to content

Formalize body parser behaviour when multiple Content-Type values provided #568

@filmaj

Description

@filmaj

Describe the issue
Backfilling an issue for PR #562.

When multiple Content-Type header values are provided (which is incorrect according to the HTTP spec), arc functions body parsing throws an exception and returns HTTP 500.

This also closely relates to #501 - improving the behaviour of the body parser when request body structure does not match the specified Content-Type.

Steps to reproduce
#501 has great repro steps to use as a base - once followed, it's easy to simply tweak the suggested curl calls to account for different request body contents and HTTP Content-Type header values.

Expected behavior
This is completely up for debate and I would love to hear what expectations others would have in this situation! For me personally, related to #501, the ideal case would be that arc/functions returns an HTTP 400 in this situation, but in contrast to what is described in #501, it would recognize that the Content-Type header provided is invalid / not to spec, and would return a relevant error message like "invalid Content-Type" or some such.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions