MCPcopy
hub / github.com/pyload/pyload / iter_headers

Method iter_headers

module/lib/bottle.py:1301–1313  ·  view source on GitHub ↗

Yield (header, value) tuples, skipping headers that are not allowed with the current response status code.

(self)

Source from the content-addressed store, hash-verified

1299 self._headers.setdefault(_hkey(name), []).append(str(value))
1300
1301 def iter_headers(self):
1302 ''' Yield (header, value) tuples, skipping headers that are not
1303 allowed with the current response status code. '''
1304 headers = self._headers.iteritems()
1305 bad_headers = self.bad_headers.get(self.status_code)
1306 if bad_headers:
1307 headers = [h for h in headers if h[0] not in bad_headers]
1308 for name, values in headers:
1309 for value in values:
1310 yield name, value
1311 if self._cookies:
1312 for c in self._cookies.values():
1313 yield 'Set-Cookie', c.OutputString()
1314
1315 def wsgiheader(self):
1316 depr('The wsgiheader method is deprecated. See headerlist.') #0.10

Callers 2

headerlistMethod · 0.95
wsgiMethod · 0.80

Calls 3

valuesMethod · 0.80
iteritemsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected