From d3ad7c4c99dd9a7f5fa902dc7a17e4787490dacc Mon Sep 17 00:00:00 2001 From: "qsr@chromium.org" Date: Tue, 15 May 2012 15:41:08 +0000 Subject: [PATCH] Fixing HTTPMultipartUpload. The ending boundary for multipart must replace the last boundary, not added after it. Review URL: https://breakpad.appspot.com/390002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@965 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/mac/HTTPMultipartUpload.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/mac/HTTPMultipartUpload.m b/src/common/mac/HTTPMultipartUpload.m index 4b008f5c..76f38f8a 100644 --- a/src/common/mac/HTTPMultipartUpload.m +++ b/src/common/mac/HTTPMultipartUpload.m @@ -32,6 +32,8 @@ @interface HTTPMultipartUpload(PrivateMethods) - (NSString *)multipartBoundary; +// Each of the following methods will append the starting multipart boundary, +// but not the ending one. - (NSData *)formDataForKey:(NSString *)key value:(NSString *)value; - (NSData *)formDataForFileContents:(NSData *)contents name:(NSString *)name; - (NSData *)formDataForFile:(NSString *)file name:(NSString *)name; @@ -67,11 +69,9 @@ NSString *fmt = @"--%@\r\nContent-Disposition: form-data; name=\"%@\"; " "filename=\"minidump.dmp\"\r\nContent-Type: application/octet-stream\r\n\r\n"; NSString *pre = [NSString stringWithFormat:fmt, boundary_, escaped]; - NSString *post = [NSString stringWithFormat:@"\r\n--%@\r\n", boundary_]; [data appendData:[pre dataUsingEncoding:NSUTF8StringEncoding]]; [data appendData:contents]; - [data appendData:[post dataUsingEncoding:NSUTF8StringEncoding]]; return data; }