aptos-core
aptos-core copied to clipboard
[API][v1] Check AcceptType in middleware instead
Currently we check accept type using a function right at the start of the endpoint handler function. We could instead make this middleware (that we conditionally apply with transform) that checks the accept type, returning 406 on an invalid type, otherwise adding the accept type with .data on the endpoint.