nopasaran.tools.checks.check_header_field

nopasaran.tools.checks.check_header_field(event, name, value=None)

Check if a header field exists and optionally check its value.

Args:

event: The event containing headers name: The header name to check for value: Optional value to match against. If None, only checks header presence

Returns:
  • True if:
    • value is None and header is found

    • value is provided and matches the header value

  • False if:
    • header is not found

    • value is provided but doesn’t match

  • None if the event doesn’t have headers