← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1108994] Re: v1 headers are encoded as UTF-8

 

** Changed in: glance
       Status: Triaged => Won't Fix

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1108994

Title:
  v1 headers are encoded as UTF-8

Status in OpenStack Image Registry and Delivery Service (Glance):
  Won't Fix

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://www.ietf.org/rfc/rfc2047.txt ).

  For reference the format of the header field contents is defined in
  section 4.2 of RFC 2616:

         field-content = <the OCTETs making up the field-value
                          and consisting of either *TEXT or combinations
                          of token, separators, and quoted-string>

  http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

  ...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,
                          but including LWS>

  http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2

  
  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.)

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1108994/+subscriptions