Permalink
Browse files

Using \r\n instead of \n

  • Loading branch information...
1 parent f8cfc9e commit 31ccde57a95a3ff5808a7717a4fc34d62c90b4d4 Igor Sutton committed Jan 14, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 NSDictionary+TumblrKit.m
View
@@ -27,7 +27,7 @@ @implementation NSDictionary (TumblrKit)
- (NSData *)multipartMIMEData
{
- NSString *format = @"--%@\nContent-Disposition: form-data; name=\"%@\"\n\n%@\n";
+ NSString *format = @"--%@\r\nContent-Disposition: form-data; name=\"%@\"\r\n\r\n%@\r\n";
NSMutableData *result = [NSMutableData data];
NSMutableDictionary *dict_ = [self mutableCopy];
@@ -46,7 +46,7 @@ - (NSData *)multipartMIMEData
for (NSString *key in dict_) {
if ([key isEqualToString:@"data"]) {
- [result appendData:[[NSString stringWithFormat:@"--%@\nContent-Disposition: form-data; name=\"%@\"\n\n", [NSString MIMEBoundary], key] dataUsingEncoding:NSUTF8StringEncoding]];
+ [result appendData:[[NSString stringWithFormat:@"--%@\r\nContent-Disposition: form-data; name=\"%@\"\r\n\r\n", [NSString MIMEBoundary], key] dataUsingEncoding:NSUTF8StringEncoding]];
[result appendData:[dict_ objectForKey:key]];
[result appendData:[@"\n" dataUsingEncoding:NSUTF8StringEncoding]];
}
@@ -55,7 +55,7 @@ - (NSData *)multipartMIMEData
}
}
- [result appendData:[[NSString stringWithFormat:@"\n--%@--\n", [NSString MIMEBoundary]] dataUsingEncoding:NSUTF8StringEncoding]];
+ [result appendData:[[NSString stringWithFormat:@"--%@--\r\n", [NSString MIMEBoundary]] dataUsingEncoding:NSUTF8StringEncoding]];
return result;
}

0 comments on commit 31ccde5

Please sign in to comment.