GlanceMultipartFormDataContentType

Adding or modifying an image metadata using the Glance API/API is done by specifying the metadata in the HTTP headers that begins with the prefix “x-image-meta-“. Some internet browsers such as Internet Explorer ignore the HTTP headers thus making it impossible to upload an image and set the metadata on the image successfully.

In addition, the _upload function in api/v#/images.py only supports “application/octet-stream” contentType. In order to overcome this limitation, we propose support for “multipart/form-data” contentType. Given a response and mapping of image metadata, injects the Response with a set of HTTP headers for the image metadata. Each main image metadata field is injected as a HTTP header with key 'x-image-meta-' except  for the properties field, which is further broken out  into a set of 'x-image-meta-property-' headers.