v1 headers are encoded as UTF-8
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
In the v1.1 API, metadata headers are echoed with the values encoded as UTF-8 (since bug 1042078).
However, UTF-8 is not a valid encoding for HTTP header values. (Indeed, some ASCII characters are also forbidden.) The output should be encoded using the MIME header encoding rules from RFC 2047 (http://
For reference the format of the header field contents is defined in section 4.2 of RFC 2616:
http://
...which must be further interpreted using section 2.2:
The TEXT rule is only used for descriptive field contents and values
that are not intended to be interpreted by the message parser. Words
of *TEXT MAY contain characters from character sets other than
ISO-8859-1 only when encoded according to the rules of RFC 2047.
TEXT = <any OCTET except CTLs,
http://
The Location: header is a special case, since its value is a URI, which needs to be URL-encoded (this brings it into the acceptable subset of ASCII, and therefore no further encoding is required).
(A similar issue in python-glanceclient is bug 1108969. The encoding of these headers is treated differently on reception, as described in bug 1108979.)
Changed in glance: | |
importance: | Undecided → Medium |
status: | New → Triaged |
tags: | added: docs |
Changed in glance: | |
assignee: | nobody → Lawrance (jing) |
Changed in glance: | |
assignee: | Lawrance (jing) → nobody |
Changed in glance: | |
status: | Triaged → Won't Fix |
You certainly have the right of it.
However, I'm not sure we can just start publishing headers in a different way. Prior to the UTF-8 fix (which was apparently incorrect) we could have made this change, but now old clients expecting UTF-8 won't know what to do with MIME encoded headers.
Unless there is some major problem caused by having the wrong encoding type, we might need to just leave this unfixed in Glance v1 and be sure to document it well.