Chromium Code Reviews| Index: util/net/http_multipart_builder.cc |
| diff --git a/util/net/http_multipart_builder.cc b/util/net/http_multipart_builder.cc |
| index 07dd837fcbb1bf95815ada72543492856f807aea..473cf5e94a5e4e917ddb402a9eefddb0edd2e2b3 100644 |
| --- a/util/net/http_multipart_builder.cc |
| +++ b/util/net/http_multipart_builder.cc |
| @@ -152,7 +152,7 @@ scoped_ptr<HTTPBodyStream> HTTPMultipartBuilder::GetBodyStream() { |
| std::vector<HTTPBodyStream*> streams; |
| for (const auto& pair : form_data_) { |
| - std::string field = GetFormDataBoundary(boundary(), pair.first); |
| + std::string field = GetFormDataBoundary(boundary_, pair.first); |
| field += kBoundaryCRLF; |
| field += pair.second; |
| field += kCRLF; |
| @@ -161,7 +161,7 @@ scoped_ptr<HTTPBodyStream> HTTPMultipartBuilder::GetBodyStream() { |
| for (const auto& pair : file_attachments_) { |
| const FileAttachment& attachment = pair.second; |
| - std::string header = GetFormDataBoundary(boundary(), pair.first); |
| + std::string header = GetFormDataBoundary(boundary_, pair.first); |
| header += base::StringPrintf("; filename=\"%s\"%s", |
| attachment.filename.c_str(), kCRLF); |
| header += base::StringPrintf("Content-Type: %s%s", |
| @@ -173,11 +173,17 @@ scoped_ptr<HTTPBodyStream> HTTPMultipartBuilder::GetBodyStream() { |
| } |
| streams.push_back( |
| - new StringHTTPBodyStream("--" + boundary() + "--" + kCRLF)); |
| + new StringHTTPBodyStream("--" + boundary_ + "--" + kCRLF)); |
| return scoped_ptr<HTTPBodyStream>(new CompositeHTTPBodyStream(streams)); |
| } |
| +HTTPHeaders::value_type HTTPMultipartBuilder::GetContentType() const { |
| + std::string content_type = |
| + base::StringPrintf("multipart/form-data; boundary=%s", boundary_.c_str()); |
| + return std::make_pair(kContentType, content_type); |
|
Mark Mentovai
2014/10/30 21:13:54
#include <utility>
Robert Sesek
2014/10/31 14:48:14
Done.
|
| +} |
| + |
| void HTTPMultipartBuilder::EraseKey(const std::string& key) { |
| auto data_it = form_data_.find(key); |
| if (data_it != form_data_.end()) |