| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 keyValuePairs.set(key, value.toString().stripWhiteSpace()); | 127 keyValuePairs.set(key, value.toString().stripWhiteSpace()); |
| 128 return keyValuePairs; | 128 return keyValuePairs; |
| 129 } | 129 } |
| 130 | 130 |
| 131 MIMEHeader* MIMEHeader::parseHeader(SharedBufferChunkReader* buffer) { | 131 MIMEHeader* MIMEHeader::parseHeader(SharedBufferChunkReader* buffer) { |
| 132 MIMEHeader* mimeHeader = MIMEHeader::create(); | 132 MIMEHeader* mimeHeader = MIMEHeader::create(); |
| 133 KeyValueMap keyValuePairs = retrieveKeyValuePairs(buffer); | 133 KeyValueMap keyValuePairs = retrieveKeyValuePairs(buffer); |
| 134 KeyValueMap::iterator mimeParametersIterator = | 134 KeyValueMap::iterator mimeParametersIterator = |
| 135 keyValuePairs.find("content-type"); | 135 keyValuePairs.find("content-type"); |
| 136 if (mimeParametersIterator != keyValuePairs.end()) { | 136 if (mimeParametersIterator != keyValuePairs.end()) { |
| 137 ParsedContentType parsedContentType(mimeParametersIterator->value); | 137 ParsedContentType parsedContentType(mimeParametersIterator->value, |
| 138 ParsedContentType::Mode::Relaxed); |
| 138 mimeHeader->m_contentType = parsedContentType.mimeType(); | 139 mimeHeader->m_contentType = parsedContentType.mimeType(); |
| 139 if (!mimeHeader->isMultipart()) { | 140 if (!mimeHeader->isMultipart()) { |
| 140 mimeHeader->m_charset = parsedContentType.charset().stripWhiteSpace(); | 141 mimeHeader->m_charset = parsedContentType.charset().stripWhiteSpace(); |
| 141 } else { | 142 } else { |
| 142 mimeHeader->m_multipartType = | 143 mimeHeader->m_multipartType = |
| 143 parsedContentType.parameterValueForName("type"); | 144 parsedContentType.parameterValueForName("type"); |
| 144 mimeHeader->m_endOfPartBoundary = | 145 mimeHeader->m_endOfPartBoundary = |
| 145 parsedContentType.parameterValueForName("boundary"); | 146 parsedContentType.parameterValueForName("boundary"); |
| 146 if (mimeHeader->m_endOfPartBoundary.isNull()) { | 147 if (mimeHeader->m_endOfPartBoundary.isNull()) { |
| 147 DVLOG(1) << "No boundary found in multipart MIME header."; | 148 DVLOG(1) << "No boundary found in multipart MIME header."; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 if (!contentID.startsWith('<') || !contentID.endsWith('>')) | 380 if (!contentID.startsWith('<') || !contentID.endsWith('>')) |
| 380 return KURL(); | 381 return KURL(); |
| 381 | 382 |
| 382 StringBuilder uriBuilder; | 383 StringBuilder uriBuilder; |
| 383 uriBuilder.append("cid:"); | 384 uriBuilder.append("cid:"); |
| 384 uriBuilder.append(contentID, 1, contentID.length() - 2); | 385 uriBuilder.append(contentID, 1, contentID.length() - 2); |
| 385 return KURL(KURL(), uriBuilder.toString()); | 386 return KURL(KURL(), uriBuilder.toString()); |
| 386 } | 387 } |
| 387 | 388 |
| 388 } // namespace blink | 389 } // namespace blink |
| OLD | NEW |