mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +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)
|
||||
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
|
||||
|
@ -502,6 +505,8 @@ class DelugeWeb(component.Component):
|
|||
else:
|
||||
self.start_normal()
|
||||
self.plugins.enable_plugins()
|
||||
|
||||
component.get("JSON").enable()
|
||||
|
||||
if start_reactor:
|
||||
reactor.run()
|
||||
|
|
Loading…
Add table
Reference in a new issue