You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it looks like if a request is missing content-type but contains a body, the body is never consumed and instead only the search params are treated as data
in this case maybe we can either:
implicitly read the body as text, and attempt JSON parsing, but ignore any error that may occur (and treat as empty body, continue to read the search params as the data)
reject the request with a 400
In the last 7 days it looks like we received ~25k POSTs with a body and no content-type to admin (excluding /hook/github and /hook/slack) so option 2 might be too aggressive.
I'm unsure of how/if those bodies are being handled at the moment, though. Maybe they're quietly being treated as empty bodies and the client is unaware the request is being handled differently than they expect? wdyt @tripodsan?
I think sending a 415 if there is a post body but no content-type is the correct behaviour. but setting the correct accept-post header is then tricky, as it depends on the route.
I'm curious what the actual POST body is of those 25k requests.
Right now it looks like if a request is missing
content-type
but contains a body, the body is never consumed and instead only the search params are treated as datain this case maybe we can either:
In the last 7 days it looks like we received ~25k POSTs with a body and no content-type to admin (excluding
/hook/github
and/hook/slack
) so option 2 might be too aggressive.I'm unsure of how/if those bodies are being handled at the moment, though. Maybe they're quietly being treated as empty bodies and the client is unaware the request is being handled differently than they expect? wdyt @tripodsan?
see also https://github.com/adobe/helix-admin/issues/2570
The text was updated successfully, but these errors were encountered: