What version are you running? 1.7.4 What's the URL of the page containing the problem? /reviewboard/r/<review num>/ What steps will reproduce the problem? 1. Create review, upload diff 2. Try to update diff Expected result: Diff is updated Actual result: "Download file" dialog appears. Looks like, IE offers to download a JSON response. Diff file is not updated in review. What operating system are you using? What browser? Windows 7, IE8. Not reproducible with Google Chrome browser and IE9/10.
No idea. We dropped support for IE8 in 1.7.x, but I'd be completely open to taking patches. Older versions of IE behave in some strange ways at times when it comes to certain AJAX calls with file uploads.
It looks like IE8 attempts to download the file when the mimetype is application/json and that is what the server is sending. There are many posts in StackOverflow around this and the answer seems to be send "text/plain" instead of "application/json" if its IE8 and everything is good. The other option is to include a "X-Content-Type-Options: nosniff" which instructs not to sniff the mimetype and serve the file as is. (Reference: http://security.stackexchange.com/questions/7506/using-file-extension-and-mime-type-as-output-by-file-i-b-combination-to-dete/7531#7531, Item 4 in the Defenses section in that post). Since IE is the only one to allow X-Content-Type-Options, can we include this in the WebApiResponse. I already see a block in WebApiResponse to convert mimetype to 'text/plain' if its not an ajax and there are uploads, but since this is an AJAX call, it wouldnt pass through this block ?
Fixed in djblets master (b784ab8). Thanks!
- PendingReview + Fixed