(self, data, type, enableGzip)
| 77 | return buf.getvalue() |
| 78 | |
| 79 | def sendResponse(self, data, type, enableGzip): |
| 80 | self.send_response(200) |
| 81 | self.send_header('Server', 'PlexConnect') |
| 82 | self.send_header('Content-type', type) |
| 83 | try: |
| 84 | accept_encoding = map(string.strip, string.split(self.headers["accept-encoding"], ",")) |
| 85 | except KeyError: |
| 86 | accept_encoding = [] |
| 87 | if enableGzip and \ |
| 88 | g_param['CSettings'].getSetting('allow_gzip_atv')=='True' and \ |
| 89 | 'gzip' in accept_encoding: |
| 90 | self.send_header('Content-encoding', 'gzip') |
| 91 | self.end_headers() |
| 92 | self.wfile.write(self.compress(data)) |
| 93 | else: |
| 94 | self.end_headers() |
| 95 | self.wfile.write(data) |
| 96 | |
| 97 | def do_GET(self): |
| 98 | global g_param |
no test coverage detected