in elastic_transport/_node/_base.py [0:0]
def __init__(self, config: NodeConfig):
self._config = config
self._headers: HttpHeaders = self.config.headers.copy() # type: ignore[attr-defined]
self.headers.setdefault("connection", "keep-alive")
self.headers.setdefault("user-agent", DEFAULT_USER_AGENT)
self._http_compress = bool(config.http_compress or False)
if config.http_compress:
self.headers["accept-encoding"] = "gzip"
self._scheme = config.scheme
self._host = config.host
self._port = config.port
self._path_prefix = (
("/" + config.path_prefix.strip("/")) if config.path_prefix else ""
)