labstack / echo

High performance, minimalist Go web framework
https://echo.labstack.com
MIT License
29.94k stars 2.23k forks source link

Allow content type middleware #2655

Open grqphical opened 4 months ago

grqphical commented 4 months ago

Based on #2551

Adds a new middleware AllowContentType which restricts routes to only accepts requests with certain Content-Type header values.

It's similar to the middleware of the same name available with Chi

The middleware also sets the Accept header field to the specified content types for all requests