Skip to content

Implement keep-alive / Connection: close / HTTP-1.0 negotiation #9

Description

@harmon25

Copilot review (PR #4, commit 489abc8, src/httpd.erl:329-331).

The code explicitly defers proper connection negotiation:

%% NOTE: HTTP/1.0 default-close and Connection: close semantics are not yet
%% implemented; that negotiation is deferred to a follow-up.  Handlers that
%% need to force a close should return {close, ...} instead.

{reply, ...} responses always keep the connection open regardless of the request's HTTP version or a Connection: close header. To be spec-compliant the server should:

  • close after the response for HTTP/1.0 unless Connection: keep-alive,
  • close when the client sends Connection: close,
  • otherwise keep-alive for HTTP/1.1.

The version field and lowercase header normalization are already in place, so the inputs needed for an is_keep_alive/1 helper exist.

Validated against current code: deferred / not yet implemented.

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