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

Side by Side Diff: third_party/WebKit/Source/platform/network/HTTPParsers.h

Issue 2310783003: Stop ignoring whitespaces in the middle of MIME type in a Content-Type header (Closed)
Patch Set: Rebase Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * Copyright (C) 2011 Apple Inc. All Rights Reserved. 4 * Copyright (C) 2011 Apple Inc. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 PLATFORM_EXPORT bool isValidHTTPFieldContentRFC7230(const String&); 98 PLATFORM_EXPORT bool isValidHTTPFieldContentRFC7230(const String&);
99 PLATFORM_EXPORT bool isValidHTTPToken(const String&); 99 PLATFORM_EXPORT bool isValidHTTPToken(const String&);
100 // |matcher| specifies a function to check a whitespace character. if |nullptr| 100 // |matcher| specifies a function to check a whitespace character. if |nullptr|
101 // is specified, ' ' and '\t' are treated as whitespace characters. 101 // is specified, ' ' and '\t' are treated as whitespace characters.
102 PLATFORM_EXPORT bool parseHTTPRefresh(const String& refresh, WTF::CharacterMatch FunctionPtr matcher, double& delay, String& url); 102 PLATFORM_EXPORT bool parseHTTPRefresh(const String& refresh, WTF::CharacterMatch FunctionPtr matcher, double& delay, String& url);
103 PLATFORM_EXPORT double parseDate(const String&); 103 PLATFORM_EXPORT double parseDate(const String&);
104 104
105 // Given a Media Type (like "foo/bar; baz=gazonk" - usually from the 105 // Given a Media Type (like "foo/bar; baz=gazonk" - usually from the
106 // 'Content-Type' HTTP header), extract and return the "type/subtype" portion 106 // 'Content-Type' HTTP header), extract and return the "type/subtype" portion
107 // ("foo/bar"). 107 // ("foo/bar").
108 // Note: This function does not in any way check that the "type/subtype" pair 108 //
109 // is well-formed. 109 // Note:
110 // - This function does not in any way check that the "type/subtype" pair
111 // is well-formed.
112 // - OWSes at the head and the tail of the region before the first semicolon
113 // are trimmed.
110 PLATFORM_EXPORT AtomicString extractMIMETypeFromMediaType(const AtomicString&); 114 PLATFORM_EXPORT AtomicString extractMIMETypeFromMediaType(const AtomicString&);
111 PLATFORM_EXPORT String extractCharsetFromMediaType(const String&); 115 PLATFORM_EXPORT String extractCharsetFromMediaType(const String&);
112 PLATFORM_EXPORT void findCharsetInMediaType(const String& mediaType, unsigned& c harsetPos, unsigned& charsetLen, unsigned start = 0); 116 PLATFORM_EXPORT void findCharsetInMediaType(const String& mediaType, unsigned& c harsetPos, unsigned& charsetLen, unsigned start = 0);
113 PLATFORM_EXPORT ReflectedXSSDisposition parseXSSProtectionHeader(const String& h eader, String& failureReason, unsigned& failurePosition, String& reportURL); 117 PLATFORM_EXPORT ReflectedXSSDisposition parseXSSProtectionHeader(const String& h eader, String& failureReason, unsigned& failurePosition, String& reportURL);
114 PLATFORM_EXPORT XFrameOptionsDisposition parseXFrameOptionsHeader(const String&) ; 118 PLATFORM_EXPORT XFrameOptionsDisposition parseXFrameOptionsHeader(const String&) ;
115 PLATFORM_EXPORT CacheControlHeader parseCacheControlDirectives(const AtomicStrin g& cacheControlHeader, const AtomicString& pragmaHeader); 119 PLATFORM_EXPORT CacheControlHeader parseCacheControlDirectives(const AtomicStrin g& cacheControlHeader, const AtomicString& pragmaHeader);
116 PLATFORM_EXPORT void parseCommaDelimitedHeader(const String& headerValue, CommaD elimitedHeaderSet&); 120 PLATFORM_EXPORT void parseCommaDelimitedHeader(const String& headerValue, CommaD elimitedHeaderSet&);
117 // Returns true on success, otherwise false. The Suborigin argument must be a 121 // Returns true on success, otherwise false. The Suborigin argument must be a
118 // non-null return argument. |messages| is a list of messages based on any 122 // non-null return argument. |messages| is a list of messages based on any
119 // parse warnings or errors. Even if parseSuboriginHeader returns true, there 123 // parse warnings or errors. Even if parseSuboriginHeader returns true, there
120 // may be Strings in |messages|. 124 // may be Strings in |messages|.
121 PLATFORM_EXPORT bool parseSuboriginHeader(const String& header, Suborigin*, WTF: :Vector<String>& messages); 125 PLATFORM_EXPORT bool parseSuboriginHeader(const String& header, Suborigin*, WTF: :Vector<String>& messages);
122 126
123 PLATFORM_EXPORT ContentTypeOptionsDisposition parseContentTypeOptionsHeader(cons t String& header); 127 PLATFORM_EXPORT ContentTypeOptionsDisposition parseContentTypeOptionsHeader(cons t String& header);
124 128
125 } // namespace blink 129 } // namespace blink
126 130
127 #endif 131 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698