labstack / echo

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

Allow content type middleware #2655

Open grqphical opened 6 days ago

grqphical commented 6 days 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