Skip to content

Commit

Permalink
Ticket 124: File Transfer multipart badly formed trips mod_security
Browse files Browse the repository at this point in the history
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
macdonst committed Apr 1, 2011
1 parent f6f8053 commit d424af0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/src/com/phonegap/FileTransfer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d424af0

Please sign in to comment.