Documentation

Std.Http.Protocol.H1.Config

HTTP/1.1 Configuration #

This module defines the configuration options for HTTP/1.1 protocol processing, including connection limits, header constraints, and various size limits.

Connection limits and parser bounds configuration.

  • maxMessages : Nat

    Maximum number of requests (server) or responses (client) per connection.

  • maxHeaders : Nat

    Maximum number of headers allowed per message.

  • maxHeaderBytes : Nat

    Maximum aggregate byte size of all header field lines in a single message (name + value bytes plus 4 bytes per line for : and \r\n). Default: 64 KiB.

  • enableKeepAlive : Bool

    Whether to enable keep-alive connections by default.

  • agentName : Option Header.Value

    The Server header value injected into outgoing responses (receiving mode) or the User-Agent header value injected into outgoing requests (sending mode). none suppresses the header entirely.

  • maxUriLength : Nat

    Maximum length of request URI (default: 8192 bytes).

  • maxStartLineLength : Nat

    Maximum number of bytes consumed while parsing request/status start-lines (default: 8192 bytes).

  • maxHeaderNameLength : Nat

    Maximum length of header field name (default: 256 bytes).

  • maxHeaderValueLength : Nat

    Maximum length of header field value (default: 8192 bytes).

  • maxSpaceSequence : Nat

    Maximum number of spaces in delimiter sequences (default: 16).

  • maxLeadingEmptyLines : Nat

    Maximum number of leading empty lines (bare CRLF) to skip before a request-line (RFC 9112 ยง2.2 robustness). Default: 8.

  • maxChunkExtensions : Nat

    Maximum number of extensions on a single chunk-size line (default: 16).

  • maxChunkExtNameLength : Nat

    Maximum length of chunk extension name (default: 256 bytes).

  • maxChunkExtValueLength : Nat

    Maximum length of chunk extension value (default: 256 bytes).

  • maxChunkLineLength : Nat

    Maximum number of bytes consumed while parsing one chunk-size line with extensions (default: 8192 bytes).

  • maxChunkSize : Nat

    Maximum allowed chunk payload size in bytes (default: 8 MiB).

  • maxBodySize : Nat

    Maximum allowed total body size per message in bytes (default: 64 MiB). This limit applies across all body framing modes. For chunked transfer encoding, chunk-size lines (including extensions) and the trailer section also count toward this limit, so the total wire bytes consumed by the body cannot exceed this value.

  • maxReasonPhraseLength : Nat

    Maximum length of reason phrase (default: 512 bytes).

  • maxTrailerHeaders : Nat

    Maximum number of trailer headers (default: 20).

Instances For