MCPcopy Index your code
hub / github.com/python/cpython / HeaderCountingBuffer

Class HeaderCountingBuffer

Lib/test/test_httplib.py:142–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 # .request() if they are explicitly set.
141
142 class HeaderCountingBuffer(list):
143 def __init__(self):
144 self.count = {}
145 def append(self, item):
146 kv = item.split(b':')
147 if len(kv) > 1:
148 # item is a 'Key: Value' header string
149 lcKey = kv[0].decode('ascii').lower()
150 self.count.setdefault(lcKey, 0)
151 self.count[lcKey] += 1
152 list.append(self, item)
153
154 for explicit_header in True, False:
155 for header in 'Content-length', 'Host', 'Accept-encoding':

Callers 1

test_auto_headersMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_auto_headersMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…