OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |