MCPcopy
hub / github.com/iBaa/PlexConnect / sendResponse

Method sendResponse

WebServer.py:79–95  ·  view source on GitHub ↗
(self, data, type, enableGzip)

Source from the content-addressed store, hash-verified

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

Callers 1

do_GETMethod · 0.95

Calls 2

compressMethod · 0.95
getSettingMethod · 0.45

Tested by

no test coverage detected