Get rid of old legacy text/plain mimetype hack from WebAPIResponse.

Review Request #8807 - Created March 9, 2017 and submitted

David Trowbridge

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 that XMLHttpRequest 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 uses XMLHttpRequest, 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 an ItemResource.
  • Uploaded file attachments via the "Update > Add File" form, drag-and-drop,
    and rbt attach.
  • Uploaded diffs via "Update > Update Diff" and rbt post.
Review Bot
Christian Hammond
David Trowbridge
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (1f91c09)