HTTP Content-Disposition Parser
Parse a disposition type and unquote its parameters, preserving RFC 5987 extended values for caller interpretation.
Description
Content-Disposition describes how content is presented and can carry filename parameters.
When to use HTTP Content-Disposition Parser
Use this tool to parse a disposition type and unquote its parameters, preserving RFC 5987 extended values for caller interpretation.
Prepare the header field value, cookie records or status code requested. Supply field values without a header-name prefix and preserve syntax for the parser to inspect.
How to use HTTP Content-Disposition Parser and understand its results
- Prepare the header field value, cookie records or status code requested. Supply field values without a header-name prefix and preserve syntax for the parser to inspect.
- Enter header using the field table and calculation rules, then run the tool.
- Read disposition, parameters. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| header | Content-Disposition field value. | string; maximum length: 1000000 | Required |
Paste the field value. Split semicolons outside quoted strings/angle brackets, validate a token disposition, lowercase parameter names and unquote/unescape values. Reject repeated normalized parameter names; filename and filename* remain distinct. Preserve extended values such as UTF-8 percent-encoded text without decoding.3
disposition=lowercase token; parameters=ordered parsed name/value entries Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| disposition | Lowercase disposition type. | string; maximum length: 1000000 |
| parameters | Parameters in source order with unquoted values. | list of object; minimum entries: 0; maximum entries: 100000 |
{
"input": {
"header": "attachment; filename=\"report;final.csv\""
},
"output": {
"disposition": "attachment",
"parameters": [
{
"name": "filename",
"value": "report;final.csv"
}
]
}
} Limitations and assumptions
No filename sanitization, path safety, charset decoding or download action is supplied. This is a syntactic parser, not an exhaustive disposition-policy validator.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use HTTP Link Header Parser: Parse RFC 8288 link targets and parameters while retaining quoted delimiters and repeated relation parameters. For a complementary task, use HTTP Content-Type Parser: Parse an HTTP media type and its parameters, preserving parameter values and rejecting duplicate names.
Further background: RFC 6266: Content-Disposition in HTTP.
References
-
HTTP Content-Disposition Parser — tool.io
-
RFC 6266: Content-Disposition in HTTP — Internet Engineering Task Force
-
HTTP Content-Type Parser — tool.io
Similar or alternative tools
- HTTP Link Header Parser
Parse RFC 8288 link targets and parameters while retaining quoted delimiters and repeated relation parameters.
- HTTP Content-Type Parser
Parse an HTTP media type and its parameters, preserving parameter values and rejecting duplicate names.