mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 09:58:39 +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
1 changed files with 5 additions and 0 deletions
|
@ -279,6 +279,9 @@ class LookupResource(resource.Resource, component.Component):
|
||||||
mime_type = mimetypes.guess_type(path)
|
mime_type = mimetypes.guess_type(path)
|
||||||
request.setHeader("content-type", mime_type[0])
|
request.setHeader("content-type", mime_type[0])
|
||||||
return open(path, "rb").read()
|
return open(path, "rb").read()
|
||||||
|
|
||||||
|
request.setResponseCode(http.NOT_FOUND)
|
||||||
|
return "<h1>404 - Not Found</h1>"
|
||||||
|
|
||||||
class TopLevel(resource.Resource):
|
class TopLevel(resource.Resource):
|
||||||
addSlash = True
|
addSlash = True
|
||||||
|
@ -502,6 +505,8 @@ class DelugeWeb(component.Component):
|
||||||
else:
|
else:
|
||||||
self.start_normal()
|
self.start_normal()
|
||||||
self.plugins.enable_plugins()
|
self.plugins.enable_plugins()
|
||||||
|
|
||||||
|
component.get("JSON").enable()
|
||||||
|
|
||||||
if start_reactor:
|
if start_reactor:
|
||||||
reactor.run()
|
reactor.run()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue