aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[API][v1] Check AcceptType in middleware instead

Open banool opened this issue 3 years ago • 0 comments

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.

banool avatar Jul 27 '22 20:07 banool