utf-8 in metadata and http header names

Bug #1068026 reported by David Hadas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
David Hadas

Bug Description

RFC2616 implicitly allows transferring utf-8 in headers (vals) but not in header names (keys)

Swift functional tests includes testing for utf-8 header names (keys) which is non aligned with the standard.
This seem to be the case when testing file metadata.
File metadata keys are than transferred as part of the http header keys (header names) as
      X-Object-Meta-<metadata_key>=metadata_name.

As a result metadata_keys in swift must be composed from a subset of ASCII characters - alpha numerics, some punctuation, not a lot else* and cannot be utf-8.

Details from the RFC:

   message-header = field-name ":" [ field-value ]
   field-name = token
   field-value = *( field-content | LWS )
   field-content = <the OCTETs making up the field-value
                    and consisting of either *TEXT or combinations
                    of token, separators, and quoted-string>

Zoom in on field-name (i.e. token)

   token = 1*<any CHAR except CTLs or separators>

Zoom on CHAR, CTL and separators:

   CHAR = <any US-ASCII character (octets 0 - 127)>

   CTL = <any US-ASCII control character
                    (octets 0 - 31) and DEL (127)>

   separators = "(" | ")" | "<" | ">" | "@"
                  | "," | ";" | ":" | "\" | <">
                  | "/" | "[" | "]" | "?" | "="
                  | "{" | "}" | SP | HT

* Thanks to Tom Anderson's summary listed in http://stackoverflow.com/questions/3561381/custom-http-headers-naming-conventions

Revision history for this message
David Hadas (david-hadas) wrote :

Typo: X-Object-Meta-<metadata_key>: <metadata_val>

Changed in swift:
assignee: nobody → David Hadas (david-hadas)
Changed in swift:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/14695

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/14695
Committed: http://github.com/openstack/swift/commit/56e757257e98f9203c79c8f4a1a9e5116b7320e8
Submitter: Jenkins
Branch: master

commit 56e757257e98f9203c79c8f4a1a9e5116b7320e8
Author: David Hadas <email address hidden>
Date: Tue Oct 23 09:48:24 2012 +0200

    Remove utf-8 in metadata and http header names

    RFC2616 implicitly allows transferring utf-8 in
    headers (vals) but not in header names (keys)

    Swift functional tests includes testing for utf-8
    header names (keys) which is non aligned with the standard.
    This seem to be the case when testing file metadata.
    File metadata keys are than transferred as part of
    the http header keys (header names) as
          X-Object-Meta-<metadata_key>=metadata_name.

    As a result metadata_keys in swift must be composed from
    a subset of ASCII characters - alpha numerics,
    some punctuation, not a lot else* and cannot be utf-8.

    On branch bp/wsgi-application-interface-4
    modified: test/functional/tests.py

    Change-Id: I1932e9d4ead83089e8a31a06d28a54f5625efb9c
    Fixes: bug 1068026
    Implements: blueprint wsgi-application-interface

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.7.5
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.