-
Notifications
You must be signed in to change notification settings - Fork 38
Description
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.