Skip to content

Main content

HTTP Header List Combination Plan

Plan comma combination only for explicit caller-qualified list fields, always preserving Set-Cookie as uncombined; no universal field-combination inference.

Loading tool…

Description

Plan comma combination only for explicit caller-qualified list fields, always preserving Set-Cookie as uncombined; no universal field-combination inference.

HTTP field names are case-insensitive, while values follow each field’s own grammar. Repeated occurrences sometimes form lists but cannot always be combined. Quoted values, optional spaces/tabs and quality weights need their own treatment; the tools here use explicit field records or a stated text subset.1

Plan comma combination only for explicit caller-qualified list fields, always preserving Set-Cookie as uncombined; no universal field-combination inference.

When to use this tool

Use this tool to plan comma combination only for explicit caller-qualified list fields, always preserving Set-Cookie as uncombined; no universal field-combination inference.

How to use the tool and how it works

  1. Enter headersJson, combinableNames using the field definitions below. For JSON text, serialize the explicit records in the shown shape.
  2. Run the operation. Correct input errors before interpreting an output.
  3. Read result.plan. Use the ordering, boundary rules and absence conditions described below.

Group headers case-insensitively. For caller-approved combinable names except Set-Cookie, join values with comma-space; otherwise return combined null.2

Input fieldMeaning and unitsAccepted input
headersJsonJSON text encoding array of {name: string, value: string}. Keep the record keys and value types shown in the decoded example below.Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies.
combinableNamesCaller-declared list-valued names eligible for comma combination; Set-Cookie is always excluded.Dense list of at most 128 strings, each at most 8,192 UTF-16 code units.

These are the decoded structures used in the example’s JSON text fields. Supply the corresponding serialized JSON strings as input.

json
{
  "headersJson": [
    {
      "name": "X-A",
      "value": "one"
    },
    {
      "name": "x-a",
      "value": "two"
    },
    {
      "name": "Set-Cookie",
      "value": "a=1"
    }
  ]
}
Output fieldInterpretation
resultObject containing the named fields below.
result.planPer-name combination plan; combined is null when combination is not allowed.
json
{
  "input": {
    "headersJson": "[{\"name\":\"X-A\",\"value\":\"one\"},{\"name\":\"x-a\",\"value\":\"two\"},{\"name\":\"Set-Cookie\",\"value\":\"a=1\"}]",
    "combinableNames": [
      "x-a",
      "set-cookie"
    ]
  },
  "output": {
    "result": {
      "plan": [
        {
          "name": "x-a",
          "indexes": [
            0,
            1
          ],
          "combined": "one, two"
        },
        {
          "name": "set-cookie",
          "indexes": [
            2
          ],
          "combined": null
        }
      ]
    }
  }
}

Limitations and assumptions

  • The caller must supply the field-specific combination policy; Set-Cookie is always left uncombined.
  • Explicit header records have name and value strings. Names must use token syntax; supported value code units are tab or 32–255 excluding DEL. Byte budgets use that single-byte representation, not UTF-8 or HTTP/2 compression.
  • Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
  • Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.

Alternative or Complementary methods

Choose field-specific parsing and combination rules rather than applying one policy to every header. Preserve occurrence order and use a full HTTP implementation for message framing and protocol-level decisions.

References

  1. RFC 9110: HTTP Semantics — RFC Editor

  2. Tool behavior and example: HTTP Header List Combination Plan — tool.io

Similar or alternative tools