MCPcopy
hub / github.com/urllib3/urllib3 / _get_decoder

Function _get_decoder

src/urllib3/response.py:356–371  ·  view source on GitHub ↗
(mode: str)

Source from the content-addressed store, hash-verified

354
355
356def _get_decoder(mode: str) -> ContentDecoder:
357 if "," in mode:
358 return MultiDecoder(mode)
359
360 # According to RFC 9110 section 8.4.1.3, recipients should
361 # consider x-gzip equivalent to gzip
362 if mode in ("gzip", "x-gzip"):
363 return GzipDecoder()
364
365 if brotli is not None and mode == "br":
366 return BrotliDecoder()
367
368 if HAS_ZSTD and mode == "zstd":
369 return ZstdDecoder()
370
371 return DeflateDecoder()
372
373
374class BytesQueueBuffer:

Callers 2

__init__Method · 0.85
_init_decoderMethod · 0.85

Calls 5

MultiDecoderClass · 0.85
GzipDecoderClass · 0.85
BrotliDecoderClass · 0.85
ZstdDecoderClass · 0.85
DeflateDecoderClass · 0.85

Tested by

no test coverage detected