Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: util/net/http_multipart_builder.cc

Issue 694483002: Treat '+' as a safe MIME type character. (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | util/net/http_multipart_builder_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 void AssertSafeMIMEType(const std::string& string) { 98 void AssertSafeMIMEType(const std::string& string) {
99 for (size_t i = 0; i < string.length(); ++i) { 99 for (size_t i = 0; i < string.length(); ++i) {
100 char c = string[i]; 100 char c = string[i];
101 CHECK((c >= 'a' && c <= 'z') || 101 CHECK((c >= 'a' && c <= 'z') ||
102 (c >= 'A' && c <= 'Z') || 102 (c >= 'A' && c <= 'Z') ||
103 (c >= '0' && c <= '9') || 103 (c >= '0' && c <= '9') ||
104 c == '/' || 104 c == '/' ||
105 c == '.' || 105 c == '.' ||
106 c == '_' || 106 c == '_' ||
107 c == '+' ||
107 c == '-'); 108 c == '-');
108 } 109 }
109 } 110 }
110 111
111 } // namespace 112 } // namespace
112 113
113 HTTPMultipartBuilder::HTTPMultipartBuilder() 114 HTTPMultipartBuilder::HTTPMultipartBuilder()
114 : boundary_(GenerateBoundaryString()), form_data_(), file_attachments_() { 115 : boundary_(GenerateBoundaryString()), form_data_(), file_attachments_() {
115 } 116 }
116 117
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 auto data_it = form_data_.find(key); 182 auto data_it = form_data_.find(key);
182 if (data_it != form_data_.end()) 183 if (data_it != form_data_.end())
183 form_data_.erase(data_it); 184 form_data_.erase(data_it);
184 185
185 auto file_it = file_attachments_.find(key); 186 auto file_it = file_attachments_.find(key);
186 if (file_it != file_attachments_.end()) 187 if (file_it != file_attachments_.end())
187 file_attachments_.erase(file_it); 188 file_attachments_.erase(file_it);
188 } 189 }
189 190
190 } // namespace crashpad 191 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | util/net/http_multipart_builder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698