Trees | Indices | Help |
---|
|
1 # -*- Mode: Python; test-case-name: flumotion.test.test_http -*- 2 # vi:si:et:sw=4:sts=4:ts=4 3 4 # Flumotion - a streaming media server 5 # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. 6 # Copyright (C) 2010,2011 Flumotion Services, S.A. 7 # All rights reserved. 8 # 9 # This file may be distributed and/or modified under the terms of 10 # the GNU Lesser General Public License version 2.1 as published by 11 # the Free Software Foundation. 12 # This file is distributed without any warranty; without even the implied 13 # warranty of merchantability or fitness for a particular purpose. 14 # See "LICENSE.LGPL" in the source distribution for more information. 15 # 16 # Headers in this file shall remain intact. 17 18 from flumotion.component.common.streamer.mfdsresources import \ 19 MultiFdSinkStreamingResource 20 21 22 __all__ = ['ICYStreamingResource'] 23 __version__ = "$Rev$" 24 25275529 headerValue = request.getHeader('Icy-MetaData') 30 request.serveIcy = (headerValue == '1') 31 32 return MultiFdSinkStreamingResource._render(self, request)3335 MultiFdSinkStreamingResource._setRequestHeaders(self, request) 36 if request.serveIcy: 37 additionalHeaders = self.streamer.get_icy_headers() 38 39 for header in additionalHeaders: 40 request.setHeader(header, additionalHeaders[header])4143 # Mimic Twisted as close as possible 44 headers = [] 45 for name, value in request.headers.items(): 46 if not name.startswith("icy"): 47 name = name.capitalize() 48 headers.append('%s: %s\r\n' % (name, value)) 49 for cookie in request.cookies: 50 headers.append('%s: %s\r\n' % ("Set-Cookie", cookie)) 51 return headers52 53 render_GET = _render 54 render_HEAD = _render
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Aug 13 06:17:27 2013 | http://epydoc.sourceforge.net |