Get rid of old legacy text/plain mimetype hack from WebAPIResponse.
Review Request #8807 — Created March 9, 2017 and submitted — Latest diff uploaded
Once upon a time, for uploading file attachments and diffs to Review Board, we
would make a request to the API by sticking a form into an iframe and
submitting it. This required an ugly hack on the API side to return the
resulting response with a text/plain mimetype, so that the browser wouldn't
suggest downloading the response. This was extra confusing because the comment
with this code was incorrect, leading one to believe thatXMLHttpRequest
was
the problem rather than submitting HTML forms.Having this fallback isn't too much of a problem for most cases, but it was
breaking the response parsing in the RBTools Python API. We've long since
replaced this with code that usesXMLHttpRequest
, and so we can get rid of this
kludge and return the correct mimetype.
- Sent a file using the RBTools Python API and saw that the response was parsed
correctly as anItemResource
. - Uploaded file attachments via the "Update > Add File" form, drag-and-drop,
andrbt attach
. - Uploaded diffs via "Update > Update Diff" and
rbt post
.