Author: damoxc

Revision: 5734

Log:
        return a 404 if no resource is found, also enable the JSON component 
when the server starts

Diff:
Modified: trunk/deluge/ui/web/server.py
===================================================================
--- trunk/deluge/ui/web/server.py       2009-09-14 09:23:46 UTC (rev 5733)
+++ trunk/deluge/ui/web/server.py       2009-09-14 09:25:27 UTC (rev 5734)
@@ -279,6 +279,9 @@
                 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 @@
         else:
             self.start_normal()
         self.plugins.enable_plugins()
+        
+        component.get("JSON").enable()
 
         if start_reactor:
             reactor.run()



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to