Skip to content

Factor out shared header-building logic in send APIs #162

@MatthewCane

Description

@MatthewCane

Rationale

send and send_file build similar headers; deduplicating reduces drift and centralizes formatting logic.

Files

  • python_ntfy/_send_functions.py (or a new internal helper module)

Tasks

  • Introduce a private helper (e.g., _build_headers(...)) to construct request headers
  • Use the helper from both send and send_file
  • Keep behavior backward-compatible (same headers for same inputs)

Acceptance criteria

  • Headers generated for equivalent inputs are identical to current behavior (except any explicitly approved changes)
  • Tests pass with coverage unchanged or improved

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions