Closed xifer closed 4 years ago
@xifer there are two different methods:
@lgallard Right, and they both use UrlsMultipartRequest which sets the content-type via an overridden callback getBodyContentType? Then params.put("Content-Type", urlContentType);
in each of the addTorrent functions adds it a second time.
Anyways I think it would be easy to comment out those two params.put("Content-Type", urlContentType);
lines and test to see if the addTorrent functions still work (ie. getBodyContentType gets called internally in Request<NetworkResponse>
(UrlsMultipartRequest's parent) and adds the content-type header field).
@xifer I see your point!! I'll be addressing this in the next release!
Done!
Release version 4.8.5 with this fixes!
Looks like Content-Type is added twice and the reverse proxy (Apache in my case) merges the fields. Had to bust out Wireshark for this one :). Attached HTTP ASCII of the captures.
Could try not setting it in MainActivity and check to see if adding torrents still works?
https://github.com/lgallard/qBittorrent-Controller/blob/32cd827d267da8d1a6aec51347845f093e0ed59d/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java#L2349 and https://github.com/lgallard/qBittorrent-Controller/blob/32cd827d267da8d1a6aec51347845f093e0ed59d/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java#L2449
https://github.com/lgallard/qBittorrent-Controller/blob/32cd827d267da8d1a6aec51347845f093e0ed59d/app/src/main/java/com/lgallardo/qbittorrentclient/UrlsMultipartRequest.java#L62
Work-around for Apache: RequestHeader edit Content-Type ",.+" ""
Nginx unaffected, sends Content-Type twice like app_working.txt.
app_proxy_broken.txt
browser_proxy_working.txt
app_working.txt