From 203fec45f4da6655a4604dc37eb43415fa0e82a2 Mon Sep 17 00:00:00 2001 From: Rico Schulte Date: Sun, 28 Jan 2007 14:52:30 +0000 Subject: [PATCH] set useauth to False by default define exceptionlist for /web/-Files --- webinterface/src/plugin.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/webinterface/src/plugin.py b/webinterface/src/plugin.py index 9152e3d7..b80e97a8 100644 --- a/webinterface/src/plugin.py +++ b/webinterface/src/plugin.py @@ -15,10 +15,15 @@ config.plugins.Webinterface = ConfigSubsection() config.plugins.Webinterface.enable = ConfigYesNo(default = True) config.plugins.Webinterface.port = ConfigInteger(80,limits = (1, 999)) config.plugins.Webinterface.includehdd = ConfigYesNo(default = False) -config.plugins.Webinterface.useauth = ConfigYesNo(default = True) +config.plugins.Webinterface.useauth = ConfigYesNo(default = False) # False, because a std. images hasnt a rootpasswd set and so no login. and a login with a empty pwd makes no sense sessions = [ ] +""" + define all files in /web to send no XML-HTTP-Headers here + all files not listed here will get an Content-Type: application/xhtml+xml charset: UTF-8 +""" +files_to_send_normal_http_headers = ['stream.m3u.xml',] """ set DEBUG to True, if twisted should write logoutput to a file. @@ -78,7 +83,10 @@ def startWebserver(): if os.path.isfile(self.path): s=myProducerStream() webif.renderPage(s, self.path, req, sessions[0]) # login? - return http.Response(responsecode.OK,{'Content-type': http_headers.MimeType('application', 'xhtml+xml', (('charset', 'UTF-8'),))},stream=s) + if self.path.split("/")[-1] in files_to_send_normal_http_headers: + return http.Response(responsecode.OK,stream=s) + else: + return http.Response(responsecode.OK,{'Content-type': http_headers.MimeType('application', 'xhtml+xml', (('charset', 'UTF-8'),))},stream=s) else: return http.Response(responsecode.NOT_FOUND) -- 2.20.1