Skip to content

h1: answer templates compare the Connection value as a whole #1702

Closed

Description

@FlorentinDUBOIS

Found during #1687 and #1696. Measured on main at 9e55ad621db2a4f738f7a0ec54401f7f8e3e8291.

#1683/#1687 made Connection handling token-based (has_connection_option, case-insensitive, comma-list aware, across all lines) on both request and response paths. The answer-template path still compares the whole value: lib/src/protocol/kawa_h1/answers.rs (compare_no_case(val_data, b"close") around line 239), used to decide whether a parsed template carries Connection: close.

Effect: an operator-written answer template with Connection: keep-alive, close or Connection: close, x-custom is not recognised as closing, so the session may keep the client connection open after an answer whose framing relies on close. All 15 built-in templates use a lone Connection: close, so the default configuration is unaffected.

Fix: reuse has_connection_option for this check; add a test with a list-valued Connection in a custom template.

Activity

  1. added a commit that references this issue on Sep 30, 2026
    4918ad4
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions