projects
/
fwx
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
add9932
)
Added support for a few more HTTP status codes
author
David Kerkeslager
<kerkeslager@gmail.com>
Fri, 13 Dec 2019 23:13:31 +0000
(18:13 -0500)
committer
David Kerkeslager
<kerkeslager@gmail.com>
Fri, 13 Dec 2019 23:13:31 +0000
(18:13 -0500)
src/fwx/__init__.py
patch
|
blob
|
history
diff --git
a/src/fwx/__init__.py
b/src/fwx/__init__.py
index
e0abb75
..
e636d78
100644
(file)
--- a/
src/fwx/__init__.py
+++ b/
src/fwx/__init__.py
@@
-266,7
+266,7
@@
REQUEST_METHODS = (
)
def default_method_not_allowed_handler(request):
)
def default_method_not_allowed_handler(request):
- return
Response(''
)
+ return
TextResponse('', status=405
)
def default_options_handler(handlers):
def handler(request):
def default_options_handler(handlers):
def handler(request):
@@
-300,8
+300,15
@@
def route_on_method(**kwargs):
def _get_status(response):
return {
200: '200 OK',
def _get_status(response):
return {
200: '200 OK',
+ 201: '201 Created',
307: '307 Temporary Redirect',
308: '308 Permanent Redirect',
307: '307 Temporary Redirect',
308: '308 Permanent Redirect',
+ 400: '400 Bad Request',
+ 401: '401 Unauthorized',
+ 403: '403 Forbidden',
+ 404: '404 Not Found',
+ 405: '405 Method Not Allowed',
+ 451: '451 Unavailable For Legal Reasons',
}[response.status]
def _get_headers(response):
}[response.status]
def _get_headers(response):