mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 19:26:25 +00:00
Twisted Web handles UnsupportedMethod for us
This commit is contained in:
parent
816ca79d8a
commit
6500f742dc
@ -569,17 +569,6 @@ def _renderHTTP_exception(request, failure):
|
||||
if code is not None:
|
||||
return _renderHTTP_exception_simple(request, text, code)
|
||||
|
||||
if failure.check(UnsupportedMethod):
|
||||
# twisted.web.server.Request.render() has support for transforming
|
||||
# this into an appropriate 501 NOT_IMPLEMENTED or 405 NOT_ALLOWED
|
||||
# return code, but nevow does not.
|
||||
method = request.method
|
||||
return _renderHTTP_exception_simple(
|
||||
request,
|
||||
"I don't know how to treat a %s request." % (method,),
|
||||
http.NOT_IMPLEMENTED,
|
||||
)
|
||||
|
||||
accept = request.getHeader("accept")
|
||||
if not accept:
|
||||
accept = "*/*"
|
||||
|
Loading…
Reference in New Issue
Block a user