bsed / gorilla

Automatically exported from code.google.com/p/gorilla
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[mux] Return a 405 when HTTP method is not supported by handler func #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Register a URL & handler with r.HandleFunc("/foo", 
myHandlerFunc).Methods("POST")
2. Using a web browser, or cURL, hit the endpoint using an HTTP GET request

What is the expected output? What do you see instead?
Ideally, a 405 Method Not Supported status should be returned, but the response 
status is a 404 File Not Found.

Original issue reported on code.google.com by nicksa...@gmail.com on 11 Sep 2012 at 9:02

GoogleCodeExporter commented 9 years ago
This is not an easy one. I've been thinking for a long time about how to 
achieve this.

Original comment by rodrigo.moraes on 12 Sep 2012 at 2:10

GoogleCodeExporter commented 9 years ago
I see what you mean (I just briefly looked at the code where the matching 
happens). I will give it a more thorough read-through after work, and see what 
I can come up with.

Original comment by nicksa...@gmail.com on 12 Sep 2012 at 5:56

GoogleCodeExporter commented 9 years ago
I'm closing the issue here, please follow it on Github.

https://github.com/gorilla/mux/issues/6

Original comment by rodrigo.moraes on 15 Dec 2012 at 12:57