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

Review Request #8807 — Created March 10, 2017 and submitted

Information

Djblets
release-0.10.x
0edb981...

Reviewers

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.
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/webapi/responses.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/responses.py
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (1f91c09)
Loading...