yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #55251
[Bug 1613703] Re: Types of form values are lost when transferred using multipart/form-data
Reviewed: https://review.openstack.org/353987
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=f85d2fdbb75618e13d424649aa16231bd9c12ebc
Submitter: Jenkins
Branch: master
commit f85d2fdbb75618e13d424649aa16231bd9c12ebc
Author: Timur Sufiev <tsufiev@xxxxxxxxxxxx>
Date: Thu Aug 11 13:40:36 2016 +0300
Fix the loss of JSON types when using multipart/form-data
To pass a binary blob in a POST request, browser sets the header
'Content-Type: multipart/form-data', which in turn causes all form
fields' values to be passed as strings. Circumvent this by storing
original field values as a JSON string on client-side and decoding it
on server-side. As a result the setting HORIZON_IMAGES_UPLOAD_MODE =
'legacy' will start working together with Glance V2.
Closes-Bug: #1613703
Change-Id: I53a8fbba15e4c3c6c17d6ef1ffe701634efda149
** Changed in: horizon
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1613703
Title:
Types of form values are lost when transferred using multipart/form-
data
Status in OpenStack Dashboard (Horizon):
Fix Released
Bug description:
Django REST wrappers defined on Horizon's server-side to receive data
from Angular modal forms rely on field values being transferred along
with their type using JSON format, i.e. number widgets produce
'{number_field: 42}', boolean fields produce '{boolean_field: true}
etc. This assumption becomes wrong when a FileField is present in such
form, because to transfer it browser has to use 'Content-Type:
multipart/form-data' header, which forces every field to pass its
value as a string.
This becomes a real problem as soon as Glance V2 API is fully
supported by Horizon, since Glance V2 requires that image properties
types obey the types defined in the schema.
To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1613703/+subscriptions
References