Respond 405 for unsupported methods instead of server error
This commit is contained in:
parent
9d25cc6c0a
commit
6091bd46a3
@ -224,7 +224,10 @@ class Application(
|
|||||||
logger.debug("Sanitized path: %r", path)
|
logger.debug("Sanitized path: %r", path)
|
||||||
|
|
||||||
# Get function corresponding to method
|
# Get function corresponding to method
|
||||||
function = getattr(self, "do_%s" % environ["REQUEST_METHOD"].upper())
|
function = getattr(
|
||||||
|
self, "do_%s" % environ["REQUEST_METHOD"].upper(), None)
|
||||||
|
if not function:
|
||||||
|
return response(*httputils.METHOD_NOT_ALLOWED)
|
||||||
|
|
||||||
# If "/.well-known" is not available, clients query "/"
|
# If "/.well-known" is not available, clients query "/"
|
||||||
if path == "/.well-known" or path.startswith("/.well-known/"):
|
if path == "/.well-known" or path.startswith("/.well-known/"):
|
||||||
|
Loading…
Reference in New Issue
Block a user