mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-04 15:43:28 +00:00
return a 404 if no resource is found, also enable the JSON component when the server starts
This commit is contained in:
parent
3367d0af48
commit
77253f835c
@ -280,6 +280,9 @@ class LookupResource(resource.Resource, component.Component):
|
||||
request.setHeader("content-type", mime_type[0])
|
||||
return open(path, "rb").read()
|
||||
|
||||
request.setResponseCode(http.NOT_FOUND)
|
||||
return "<h1>404 - Not Found</h1>"
|
||||
|
||||
class TopLevel(resource.Resource):
|
||||
addSlash = True
|
||||
|
||||
@ -503,6 +506,8 @@ class DelugeWeb(component.Component):
|
||||
self.start_normal()
|
||||
self.plugins.enable_plugins()
|
||||
|
||||
component.get("JSON").enable()
|
||||
|
||||
if start_reactor:
|
||||
reactor.run()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user