| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Adam Barth. All Rights Reserved. | 2 * Copyright (C) 2011 Adam Barth. All Rights Reserved. |
| 3 * Copyright (C) 2011 Daniel Bates (dbates@intudata.com). | 3 * Copyright (C) 2011 Daniel Bates (dbates@intudata.com). |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (xssProtectionHeader == ReflectedXSSInvalid) | 291 if (xssProtectionHeader == ReflectedXSSInvalid) |
| 292 document->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel
, "Error parsing header X-XSS-Protection: " + headerValue + ": " + errorDetails
+ " at character position " + String::format("%u", errorPosition) + ". The defa
ult protections will be applied."); | 292 document->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel
, "Error parsing header X-XSS-Protection: " + headerValue + ": " + errorDetails
+ " at character position " + String::format("%u", errorPosition) + ". The defa
ult protections will be applied."); |
| 293 | 293 |
| 294 ReflectedXSSDisposition cspHeader = document->contentSecurityPolicy()->r
eflectedXSSDisposition(); | 294 ReflectedXSSDisposition cspHeader = document->contentSecurityPolicy()->r
eflectedXSSDisposition(); |
| 295 m_didSendValidCSPHeader = cspHeader != ReflectedXSSUnset && cspHeader !=
ReflectedXSSInvalid; | 295 m_didSendValidCSPHeader = cspHeader != ReflectedXSSUnset && cspHeader !=
ReflectedXSSInvalid; |
| 296 | 296 |
| 297 m_xssProtection = combineXSSProtectionHeaderAndCSP(xssProtectionHeader,
cspHeader); | 297 m_xssProtection = combineXSSProtectionHeaderAndCSP(xssProtectionHeader,
cspHeader); |
| 298 // FIXME: Combine the two report URLs in some reasonable way. | 298 // FIXME: Combine the two report URLs in some reasonable way. |
| 299 if (auditorDelegate) | 299 if (auditorDelegate) |
| 300 auditorDelegate->setReportURL(xssProtectionReportURL.copy()); | 300 auditorDelegate->setReportURL(xssProtectionReportURL.copy()); |
| 301 FormData* httpBody = documentLoader->originalRequest().httpBody(); | 301 FormData* httpBody = documentLoader->request().httpBody(); |
| 302 if (httpBody && !httpBody->isEmpty()) { | 302 if (httpBody && !httpBody->isEmpty()) { |
| 303 httpBodyAsString = httpBody->flattenToString(); | 303 httpBodyAsString = httpBody->flattenToString(); |
| 304 if (!httpBodyAsString.isEmpty()) { | 304 if (!httpBodyAsString.isEmpty()) { |
| 305 m_decodedHTTPBody = fullyDecodeString(httpBodyAsString, m_encodi
ng); | 305 m_decodedHTTPBody = fullyDecodeString(httpBodyAsString, m_encodi
ng); |
| 306 if (m_decodedHTTPBody.find(isRequiredForInjection) == kNotFound) | 306 if (m_decodedHTTPBody.find(isRequiredForInjection) == kNotFound) |
| 307 m_decodedHTTPBody = String(); | 307 m_decodedHTTPBody = String(); |
| 308 if (m_decodedHTTPBody.length() >= miniumLengthForSuffixTree) | 308 if (m_decodedHTTPBody.length() >= miniumLengthForSuffixTree) |
| 309 m_decodedHTTPBodySuffixTree = adoptPtr(new SuffixTree<ASCIIC
odebook>(m_decodedHTTPBody, suffixTreeDepth)); | 309 m_decodedHTTPBodySuffixTree = adoptPtr(new SuffixTree<ASCIIC
odebook>(m_decodedHTTPBody, suffixTreeDepth)); |
| 310 } | 310 } |
| 311 } | 311 } |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 } | 729 } |
| 730 | 730 |
| 731 bool XSSAuditor::isSafeToSendToAnotherThread() const | 731 bool XSSAuditor::isSafeToSendToAnotherThread() const |
| 732 { | 732 { |
| 733 return m_documentURL.isSafeToSendToAnotherThread() | 733 return m_documentURL.isSafeToSendToAnotherThread() |
| 734 && m_decodedURL.isSafeToSendToAnotherThread() | 734 && m_decodedURL.isSafeToSendToAnotherThread() |
| 735 && m_decodedHTTPBody.isSafeToSendToAnotherThread(); | 735 && m_decodedHTTPBody.isSafeToSendToAnotherThread(); |
| 736 } | 736 } |
| 737 | 737 |
| 738 } // namespace WebCore | 738 } // namespace WebCore |
| OLD | NEW |