Permalink
Browse files

Ticket 124: File Transfer multipart badly formed trips mod_security

A standard from has no trailing whitespace after a content-disposition line like so: "Content-Disposition: form-data; name="data";" however when using the extra params of Android FileTransfer a space is added on the end "Content-Disposition: form-data; name="data"; "

This fix simply removes the trailing whitespace.
  • Loading branch information...
1 parent f6f8053 commit d424af03e47b46978ce53b1994c00ba7ac89081b @macdonst macdonst committed Apr 1, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 framework/src/com/phonegap/FileTransfer.java
@@ -272,7 +272,7 @@ public FileUploadResult upload(String file, String server, final String fileKey,
for (Iterator iter = params.keys(); iter.hasNext();) {
Object key = iter.next();
dos.writeBytes(LINE_START + BOUNDRY + LINE_END);
- dos.writeBytes("Content-Disposition: form-data; name=\"" + key.toString() + "\"; ");
+ dos.writeBytes("Content-Disposition: form-data; name=\"" + key.toString() + "\";");
dos.writeBytes(LINE_END + LINE_END);
dos.writeBytes(params.getString(key.toString()));
dos.writeBytes(LINE_END);

0 comments on commit d424af0

Please sign in to comment.