Search code examples
httpheaderwhitespacemime

Is white space allowed betwee mime header field-name and ':' separator


Within a mime header, is white space allowed between the header field-name and ':' separator? For example, are:

Content-Type: <value>

and

Content-Type  : <value>

equivalent?

Also, can you please provide a pointer to the mime standard where this is described? I checked a few but did not find it.

Thanks


Solution

  • It isn't entirely clear whether it is or is not allowed, by the standard. However, implementations vary in how they handle whitespace between header field names and the colon. I would highly recommend avoiding whitespace there if you can.

    The RFC for reference. This somewhat old article discusses the issue for HTTP headers, a similar standard.