Using the excellent Gorilla mux I have special handler for API requests using application/json as content-type:
apiRouter := router.PathPrefix("/api").Headers("Content-Type", "application/json").Subrouter()
However, some users like to provide more than just that string, i.e. application/json; charset=UTF-8. When this header value is set, the handler returns a 404.
What's the best way to handle this by allowing json and any charset specs?