Skip to content

fix(httpv1): non-UTF-8 octets in HTTP/1 header values are re-encoded as UTF-8 on rebuild #1302

Closed

Description

@JarryShaw

Describe the bug
HTTP/1 header values are decoded with a guessed charset, then re-encoded as UTF-8 when the message is rebuilt (httpv1.py around line 322). #1241 / #1301 fix the same problem for start lines, but not for header values.

To Reproduce
HTTP(b'HTTP/1.1 200 OK\r\nX-Name: caf\xe9\r\n\r\n') rebuilds through from_data as …X-Name: caf\xc3\xa9….

Expected behavior
Header values round-trip byte-exactly. This needs a charset recorded for each header in the data model, or the raw bytes kept.

Found by the #1301 worker.

Found by the application round-trip audit (#1202). The repro was re-checked by an independent verifier, and I re-ran it on main at 11ae68ebf.

Activity

  1. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1301 merges, because both edit ftp.py/httpv1.py and their data models.

  2. added
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  3. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1301 merged at 19:09Z, so the file conflict is gone. Back to pending until a worker picks it up.

  4. added
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  5. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 7, 2026
  6. added this to the PyPCAPKit v1.5 milestone on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions