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

Side by Side Diff: third_party/WebKit/Source/platform/network/FormDataEncoder.cpp

Issue 2687863002: Fix enctype=text/plain implementation (Closed)
Patch Set: Fix typo Created 3 years, 10 months 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 | « third_party/WebKit/LayoutTests/http/tests/misc/resources/form-post-textplain.php ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 7 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
8 * (http://www.torchmobile.com/) 8 * (http://www.torchmobile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 append(buffer, "\r\n\r\n"); 182 append(buffer, "\r\n\r\n");
183 } 183 }
184 184
185 void FormDataEncoder::addKeyValuePairAsFormData( 185 void FormDataEncoder::addKeyValuePairAsFormData(
186 Vector<char>& buffer, 186 Vector<char>& buffer,
187 const CString& key, 187 const CString& key,
188 const CString& value, 188 const CString& value,
189 EncodedFormData::EncodingType encodingType, 189 EncodedFormData::EncodingType encodingType,
190 Mode mode) { 190 Mode mode) {
191 if (encodingType == EncodedFormData::TextPlain) { 191 if (encodingType == EncodedFormData::TextPlain) {
192 if (!buffer.isEmpty())
193 append(buffer, "\r\n");
194 append(buffer, key); 192 append(buffer, key);
195 append(buffer, '='); 193 append(buffer, '=');
196 append(buffer, value); 194 append(buffer, value);
195 append(buffer, "\r\n");
197 } else { 196 } else {
198 if (!buffer.isEmpty()) 197 if (!buffer.isEmpty())
199 append(buffer, '&'); 198 append(buffer, '&');
200 encodeStringAsFormData(buffer, key, mode); 199 encodeStringAsFormData(buffer, key, mode);
201 append(buffer, '='); 200 append(buffer, '=');
202 encodeStringAsFormData(buffer, value, mode); 201 encodeStringAsFormData(buffer, value, mode);
203 } 202 }
204 } 203 }
205 204
206 void FormDataEncoder::encodeStringAsFormData(Vector<char>& buffer, 205 void FormDataEncoder::encodeStringAsFormData(Vector<char>& buffer,
(...skipping 21 matching lines...) Expand all
228 appendPercentEncoded(buffer, c); 227 appendPercentEncoded(buffer, c);
229 } 228 }
230 } else { 229 } else {
231 appendPercentEncoded(buffer, c); 230 appendPercentEncoded(buffer, c);
232 } 231 }
233 } 232 }
234 } 233 }
235 } 234 }
236 235
237 } // namespace blink 236 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/misc/resources/form-post-textplain.php ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698