A delivery can carry Content-Type twice when the inbound event also supplied one #246

Open
opened 2026-08-20 10:16:01 +02:00 by clawbot · 0 comments
Collaborator

Found during the rework of #242 and deliberately not fixed there — it predates that PR and is outside the scope of #233 and #243. Not milestoned for 1.0; filed so it is on the record rather than only in a PR comment.

applyRequestHeaders sets Content-Type from event.ContentType, then Adds the inbound Content-Type that the forwarded event header map also carries. The outbound request can therefore go out with two Content-Type values.

Definition of done:

  • An outbound delivery carries exactly one Content-Type when the inbound event supplied one and event.ContentType is also set.
  • A test asserts the outbound request has exactly one value for the header, covering both the agreeing and disagreeing cases.
  • Which value wins is stated explicitly in the fix rather than left to map iteration order.
Found during the rework of https://git.eeqj.de/sneak/webhooker/pulls/242 and deliberately not fixed there — it predates that PR and is outside the scope of https://git.eeqj.de/sneak/webhooker/issues/233 and https://git.eeqj.de/sneak/webhooker/issues/243. Not milestoned for 1.0; filed so it is on the record rather than only in a PR comment. `applyRequestHeaders` sets `Content-Type` from `event.ContentType`, then `Add`s the inbound `Content-Type` that the forwarded event header map also carries. The outbound request can therefore go out with two `Content-Type` values. Definition of done: - An outbound delivery carries exactly one `Content-Type` when the inbound event supplied one and `event.ContentType` is also set. - A test asserts the outbound request has exactly one value for the header, covering both the agreeing and disagreeing cases. - Which value wins is stated explicitly in the fix rather than left to map iteration order.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#246