MCPcopy
hub / github.com/tornadoweb/tornado / clear_header

Method clear_header

tornado/web.py:408–415  ·  view source on GitHub ↗

Clears an outgoing header, undoing a previous `set_header` call. Note that this method does not apply to multi-valued headers set by `add_header`.

(self, name: str)

Source from the content-addressed store, hash-verified

406 self._headers.add(name, self._convert_header_value(value))
407
408 def clear_header(self, name: str) -> None:
409 """Clears an outgoing header, undoing a previous `set_header` call.
410
411 Note that this method does not apply to multi-valued headers
412 set by `add_header`.
413 """
414 if name in self._headers:
415 del self._headers[name]
416
417 # https://www.rfc-editor.org/rfc/rfc9110#name-field-values
418 _VALID_HEADER_CHARS = re.compile(r"[\x09\x20-\x7e\x80-\xff]*")

Callers 3

_accept_connectionMethod · 0.80
getMethod · 0.80

Calls

no outgoing calls

Tested by 1

getMethod · 0.64