def renderHTTP(self, ctx):
        req = IRequest(ctx)
        if not self.canCompress(req):
            return self.underlying.renderHTTP(ctx)

        req = CompressingRequestWrapper(req)
        ctx.remember(req, IRequest)

        def _cbDoneRendering(html):
            if isinstance(html, str):
                req.write(html)
                req.finishRequest(True)
                return errorMarker
            return html

        return maybeDeferred(self.underlying.renderHTTP, ctx).addCallback(_cbDoneRendering)
Render the underlying resource with a wrapped request.
dataset/ETHPy150Open twisted/nevow/nevow/compression.py/CompressingResourceWrapper.renderHTTP