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
@ -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…
x
Reference in New Issue
Block a user