| OLD | NEW |
| 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 29 matching lines...) Expand all Loading... |
| 40 class HTTPHeaderMap; | 40 class HTTPHeaderMap; |
| 41 class ResourceResponseBase; | 41 class ResourceResponseBase; |
| 42 | 42 |
| 43 typedef enum { | 43 typedef enum { |
| 44 ContentDispositionNone, | 44 ContentDispositionNone, |
| 45 ContentDispositionInline, | 45 ContentDispositionInline, |
| 46 ContentDispositionAttachment, | 46 ContentDispositionAttachment, |
| 47 ContentDispositionOther | 47 ContentDispositionOther |
| 48 } ContentDispositionType; | 48 } ContentDispositionType; |
| 49 | 49 |
| 50 #if ENABLE(NOSNIFF) | |
| 51 enum ContentTypeOptionsDisposition { | 50 enum ContentTypeOptionsDisposition { |
| 52 ContentTypeOptionsNone, | 51 ContentTypeOptionsNone, |
| 53 ContentTypeOptionsNosniff | 52 ContentTypeOptionsNosniff |
| 54 }; | 53 }; |
| 55 #endif | |
| 56 | 54 |
| 57 enum XFrameOptionsDisposition { | 55 enum XFrameOptionsDisposition { |
| 58 XFrameOptionsNone, | 56 XFrameOptionsNone, |
| 59 XFrameOptionsDeny, | 57 XFrameOptionsDeny, |
| 60 XFrameOptionsSameOrigin, | 58 XFrameOptionsSameOrigin, |
| 61 XFrameOptionsAllowAll, | 59 XFrameOptionsAllowAll, |
| 62 XFrameOptionsInvalid, | 60 XFrameOptionsInvalid, |
| 63 XFrameOptionsConflict | 61 XFrameOptionsConflict |
| 64 }; | 62 }; |
| 65 | 63 |
| 66 ContentDispositionType contentDispositionType(const String&); | 64 ContentDispositionType contentDispositionType(const String&); |
| 67 bool isValidHTTPHeaderValue(const String&); | 65 bool isValidHTTPHeaderValue(const String&); |
| 68 bool isValidHTTPToken(const String&); | 66 bool isValidHTTPToken(const String&); |
| 69 bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& del
ay, String& url); | 67 bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& del
ay, String& url); |
| 70 double parseDate(const String&); | 68 double parseDate(const String&); |
| 71 String filenameFromHTTPContentDisposition(const String&); | 69 String filenameFromHTTPContentDisposition(const String&); |
| 72 String extractMIMETypeFromMediaType(const String&); | 70 String extractMIMETypeFromMediaType(const String&); |
| 73 String extractCharsetFromMediaType(const String&); | 71 String extractCharsetFromMediaType(const String&); |
| 74 void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, u
nsigned int& charsetLen, unsigned int start = 0); | 72 void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, u
nsigned int& charsetLen, unsigned int start = 0); |
| 75 ContentSecurityPolicy::ReflectedXSSDisposition parseXSSProtectionHeader(const St
ring& header, String& failureReason, unsigned& failurePosition, String& reportUR
L); | 73 ContentSecurityPolicy::ReflectedXSSDisposition parseXSSProtectionHeader(const St
ring& header, String& failureReason, unsigned& failurePosition, String& reportUR
L); |
| 76 String extractReasonPhraseFromHTTPStatusLine(const String&); | 74 String extractReasonPhraseFromHTTPStatusLine(const String&); |
| 77 XFrameOptionsDisposition parseXFrameOptionsHeader(const String&); | 75 XFrameOptionsDisposition parseXFrameOptionsHeader(const String&); |
| 78 | 76 |
| 79 // -1 could be set to one of the return parameters to indicate the value is not
specified. | 77 // -1 could be set to one of the return parameters to indicate the value is not
specified. |
| 80 bool parseRange(const String&, long long& rangeOffset, long long& rangeEnd, long
long& rangeSuffixLength); | 78 bool parseRange(const String&, long long& rangeOffset, long long& rangeEnd, long
long& rangeSuffixLength); |
| 81 | 79 |
| 82 #if ENABLE(NOSNIFF) | |
| 83 ContentTypeOptionsDisposition parseContentTypeOptionsHeader(const String& header
); | 80 ContentTypeOptionsDisposition parseContentTypeOptionsHeader(const String& header
); |
| 84 #endif | |
| 85 | 81 |
| 86 // Parsing Complete HTTP Messages. | 82 // Parsing Complete HTTP Messages. |
| 87 enum HTTPVersion { Unknown, HTTP_1_0, HTTP_1_1 }; | 83 enum HTTPVersion { Unknown, HTTP_1_0, HTTP_1_1 }; |
| 88 size_t parseHTTPRequestLine(const char* data, size_t length, String& failureReas
on, String& method, String& url, HTTPVersion&); | 84 size_t parseHTTPRequestLine(const char* data, size_t length, String& failureReas
on, String& method, String& url, HTTPVersion&); |
| 89 size_t parseHTTPHeader(const char* data, size_t length, String& failureReason, A
tomicString& nameStr, String& valueStr); | 85 size_t parseHTTPHeader(const char* data, size_t length, String& failureReason, A
tomicString& nameStr, String& valueStr); |
| 90 size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned cha
r>& body); | 86 size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned cha
r>& body); |
| 91 | 87 |
| 92 } | 88 } |
| 93 | 89 |
| 94 #endif | 90 #endif |
| OLD | NEW |