MCPcopy
hub / github.com/aio-libs/aiohttp / _decode_content

Method _decode_content

aiohttp/multipart.py:457–467  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

455 return data
456
457 def _decode_content(self, data):
458 encoding = self.headers[CONTENT_ENCODING].lower()
459
460 if encoding == 'deflate':
461 return zlib.decompress(data, -zlib.MAX_WBITS)
462 elif encoding == 'gzip':
463 return zlib.decompress(data, 16 + zlib.MAX_WBITS)
464 elif encoding == 'identity':
465 return data
466 else:
467 raise RuntimeError('unknown content encoding: {}'.format(encoding))
468
469 def _decode_content_transfer(self, data):
470 encoding = self.headers[CONTENT_TRANSFER_ENCODING].lower()

Callers 1

decodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected