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

Method update_auto_headers

aiohttp/client_reqrep.py:197–210  ·  view source on GitHub ↗
(self, skip_auto_headers)

Source from the content-addressed store, hash-verified

195 self.headers.add(key, value)
196
197 def update_auto_headers(self, skip_auto_headers):
198 self.skip_auto_headers = skip_auto_headers
199 used_headers = set(self.headers) | skip_auto_headers
200
201 for hdr, val in self.DEFAULT_HEADERS.items():
202 if hdr not in used_headers:
203 self.headers.add(hdr, val)
204
205 # add host
206 if hdrs.HOST not in used_headers:
207 self.headers[hdrs.HOST] = self.netloc
208
209 if hdrs.USER_AGENT not in used_headers:
210 self.headers[hdrs.USER_AGENT] = self.SERVER_SOFTWARE
211
212 def update_cookies(self, cookies):
213 """Update request cookies header."""

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected