Skip to content

Commit

Permalink
calculate the content length correctly when the content disposition h…
Browse files Browse the repository at this point in the history
…eader contains unicode multi-byte characters
  • Loading branch information
c99koder committed Sep 18, 2018
1 parent 0371fd0 commit f242cc0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion irccloud-android.iml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/legacy_multidex_aapt_derived_proguard_rules" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/legacy_multidex_main_dex_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint_jar" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
Expand Down
2 changes: 1 addition & 1 deletion src/com/irccloud/android/activity/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6528,7 +6528,7 @@ public void run() {
http.setReadTimeout(60000);
http.setConnectTimeout(60000);
http.setDoOutput(true);
http.setFixedLengthStreamingMode(total + (boundary.length() * 2) + original_filename.length() + type.length() + 88);
http.setFixedLengthStreamingMode(total + (boundary.length() * 2) + original_filename.getBytes().length + type.length() + 88);
http.setRequestProperty("User-Agent", NetworkConnection.getInstance().useragent);
http.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
http.setRequestProperty("Cookie", "session=" + NetworkConnection.getInstance().session);
Expand Down

0 comments on commit f242cc0

Please sign in to comment.