MCPcopy
hub / github.com/aio-libs/aiohttp / _add_default_headers

Method _add_default_headers

aiohttp/protocol.py:677–690  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

675 self.transport.write(headers)
676
677 def _add_default_headers(self):
678 # set the connection header
679 connection = None
680 if self.upgrade:
681 connection = 'upgrade'
682 elif not self.closing if self.keepalive is None else self.keepalive:
683 if self.version == HttpVersion10:
684 connection = 'keep-alive'
685 else:
686 if self.version == HttpVersion11:
687 connection = 'close'
688
689 if connection is not None:
690 self.headers[hdrs.CONNECTION] = connection
691
692 def write(self, chunk, *,
693 drain=False, EOF_MARKER=EOF_MARKER, EOL_MARKER=EOL_MARKER):

Callers 1

send_headersMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected