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