You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a reason you can't use a middleware to catch 405s?
It means there's an unfortunate amount of legwork you need to do (it requires having a custom http.ResponseWriter), but such a middleware would be more widely applicable than a Goji router-specific hack—if another middleware layer returned an HTTP 405 of its own, for instance, you could set things up such that your middleware would also catch it.
I think c.Env[web.ValidMethodsKey] is what I was looking for. I just didn't realize this was available until now. I'll try it out when I get some time but I suspect it should be similar to the automatic options middleware. Thanks.
When a path matches but the method doesn't, I'd like to respond with a custom MethodNotAllowed handler. Is this something you'd consider?
The text was updated successfully, but these errors were encountered: