From: Felix Domke Date: Fri, 14 Jul 2006 23:30:33 +0000 (+0000) Subject: fix static responses X-Git-Tag: 2.6.0~3156 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/982001658e3e55d320d747717fcf8e56c2cec1b6?hp=c2028c9cf56b0c23813bcbf0fae06f3123bbadd0 fix static responses --- diff --git a/lib/python/Plugins/Extensions/WebInterface/plugin.py b/lib/python/Plugins/Extensions/WebInterface/plugin.py index c61424c8..84a82331 100644 --- a/lib/python/Plugins/Extensions/WebInterface/plugin.py +++ b/lib/python/Plugins/Extensions/WebInterface/plugin.py @@ -4,14 +4,14 @@ sessions = [ ] def startWebserver(): from twisted.internet import reactor - from twisted.web2 import server, http, static, resource, stream + from twisted.web2 import server, http, static, resource, stream, http_headers, responsecode import webif class ScreenPage(resource.Resource): def render(self, req): global sessions if sessions == [ ]: - return http.Response("please wait until enigma has booted") + return http.Response(200, stream="please wait until enigma has booted") s = stream.ProducerStream() webif.renderPage(s, req, sessions[0]) # login? @@ -21,7 +21,8 @@ def startWebserver(): addSlash = True def render(self, req): - return 'Hello! you want probably go to the test instead.' + return http.Response(responsecode.OK, {'Content-type': http_headers.MimeType('text', 'html')}, + stream='Hello! you want probably go to the test instead.') child_test = ScreenPage() # "/test" child_hdd = static.File("/hdd")