• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

localstack / localstack / 21765279428

06 Feb 2026 08:43PM UTC coverage: 73.535% (-13.3%) from 86.871%
21765279428

Pull #13716

github

web-flow
Merge 0f5988375 into 20cc1b384
Pull Request #13716: Events: improve Store IAM Statement typing

6 of 6 new or added lines in 1 file covered. (100.0%)

9920 existing lines in 273 files now uncovered.

56187 of 76409 relevant lines covered (73.53%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/localstack-core/localstack/aws/handlers/codec.py
1
import gzip
1✔
2

3
from localstack.aws.api import RequestContext
1✔
4
from localstack.aws.chain import Handler, HandlerChain
1✔
5
from localstack.http import Response
1✔
6

7

8
class ContentDecoder(Handler):
1✔
9
    """
10
    A handler which takes care of decoding the content of a request (if the header "Content-Encoding" is set).
11

12
    The Content-Encoding representation header lists any encodings that have been applied to the representation
13
    (message payload), and in what order.
14
    """
15

16
    # Some services _break_ the specification of Content-Encoding (f.e. in combination with Content-MD5).
17
    SKIP_GZIP_SERVICES = ["s3"]
1✔
18

19
    def __call__(self, chain: HandlerChain, context: RequestContext, response: Response):
1✔
20
        if context.service and context.service.service_name in self.SKIP_GZIP_SERVICES:
1✔
21
            # Skip the decoding for services which need to do this on their own
22
            return
1✔
23

24
        # Currently, only GZIP is supported. When supporting multiple types, the order needs to be respected
25
        if context.request.content_encoding and context.request.content_encoding.lower() == "gzip":
1✔
26
            # wrap the request's stream with GZip decompression (inspired by flask-inflate)
UNCOV
27
            context.request.stream = gzip.GzipFile(fileobj=context.request.stream)
×
UNCOV
28
            context.request.headers["Content-Encoding"] = "identity"
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc