itty icon indicating copy to clipboard operation
itty copied to clipboard

Adding support for returning a 405 status

Open gnrfan opened this issue 12 years ago • 1 comments

... that is when the HTTP method used in the request is not supported by the framework.

Using the example in the README file and curl as the client.

Before the patch:

$ curl -XBOOM -vv http://localhost:8080/
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> BOOM /something HTTP/1.1
> User-Agent: curl/7.27.0
> Host: localhost:8080
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 404 NOT FOUND
< Date: Sun, 03 Mar 2013 15:24:46 GMT
< Server: WSGIServer/0.1 Python/2.7.3
< Content-Type: text/plain; charset=utf-8
< 
* Closing connection #0
Not Found

After the patch:

$ curl -XBOOM -vv http://localhost:8080/
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> BOOM /something HTTP/1.1
> User-Agent: curl/7.27.0
> Host: localhost:8080
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 405 METHOD NOT ALLOWED
< Date: Sun, 03 Mar 2013 15:26:15 GMT
< Server: WSGIServer/0.1 Python/2.7.3
< Content-Type: text/plain; charset=utf-8
< 
* Closing connection #0
Method Not Allowed

gnrfan avatar Mar 03 '13 15:03 gnrfan

Cool! Works so good for me.

puentesarrin avatar Mar 04 '13 22:03 puentesarrin