def do_PUT(self):
        print(self.path, flush=True)

        content_encoding = self.headers['X-Endless-Content-Encoding']
        print(content_encoding, flush=True)

        content_length = int(self.headers['Content-Length'])
        compressed_request_body = self.rfile.read(content_length)
        decompressed_request_body = gzip.decompress(compressed_request_body)
        print(len(decompressed_request_body), flush=True)
        sys.stdout.buffer.write(decompressed_request_body)
        sys.stdout.buffer.flush()

        status_code_str = sys.stdin.readline()
        status_code = int(status_code_str)
        self.send_response(status_code)
        self.end_headers()