Tool: Pyflakes Processed Files: djblets/webapi/responses.py Tool: PEP8 Style Checker Processed Files: djblets/webapi/responses.py
Get rid of old legacy text/plain mimetype hack from WebAPIResponse.
Review Request #8807 - Created March 10, 2017 and submitted
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
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
- Uploaded file attachments via the "Update > Add File" form, drag-and-drop,
- Uploaded diffs via "Update > Update Diff" and