diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py index d31f9643f..035f50123 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -203,13 +203,15 @@ class LookupResource(resource.Resource, component.Component): request.path = path return self - def render(self, request): + def render(self, request): + log.debug("Requested path: '%s'", request.path) for lookup in self.directories: if request.path in os.listdir(lookup): - path = os.path.join(lookup, request.path) + path = os.path.join(lookup, request.path) + log.debug("Serving path: '%s'", path) mime_type = mimetypes.guess_type(path) request.setHeader("content-type", mime_type[0]) - return open(path).read() + return open(path, "rb").read() request.setResponseCode(http.NOT_FOUND) return "