def handle_asset(self, filename): # TODO(wickman) Add static_content to bottle. if filename in self._assets: mimetype, encoding = mimetypes.guess_type(filename) headers = {} if mimetype: headers['Content-Type'] = mimetype if encoding: headers['Content-Encoding'] = encoding return HTTPResponse(self._assets[filename], header=headers) else: HttpServer.abort(404, 'Unknown asset: %s' % filename)
def handle_favicon(self): HttpServer.redirect("/assets/favicon.ico")
def __init__(self): self._thread = None HttpServer.__init__(self) app.Module.__init__(self, __name__, description="Http subsystem.")