RFC Errata
RFC 2183, "Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field", August 1997
Source of RFC: Legacy
Errata ID: 5330
Status: Reported
Type: Technical
Publication Format(s) : TEXT
Reported By: Daniel Beardsmore
Date Reported: 2018-04-20
Section 2 says:
NOTE ON PARAMETER VALUE LENGHTS: A short (length <= 78 characters) parameter value containing only non-`tspecials' characters SHOULD be represented as a single `token'. A short parameter value containing only ASCII characters, but including `tspecials' characters, SHOULD be represented as `quoted-string'. Parameter values longer than 78 characters, or which contain non-ASCII characters, MUST be encoded as specified in [RFC 2184].
It should say:
NOTE ON PARAMETER VALUE LENGTHS: A short (length <= 78 characters) parameter value formed solely from characters valid for a `token' SHOULD be represented as a single `token', and not as a `quoted-string'. Parameter values longer than 78 characters, or which contain non-ASCII characters, MUST be encoded as specified in [RFC 2184].
Notes:
The RFC seems to assume that token = ASCII - tspecials. Token in fact is defined more strictly: token := 1*<any (US-ASCII) CHAR except SPACE, CTLs, or tspecials>.
Consequently, a value with spaces (such as "Some file.txt"), which is a value without any tspecials, is expected to be recorded as a token, when in fact this is impossible. The same applies to CTLs.
I've written the corrected text according to the apparent intent, to avoid quotes around the value when they are unnecessary. You may wish to revise the correction for clarity or to better suit the intent of this restriction.