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

Side by Side Diff: third_party/WebKit/Source/core/loader/PingLoader.cpp

Issue 2717463006: Change XSS Auditor report's MIME type. (Closed)
Patch Set: tests Created 3 years, 9 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 sendPingCommon(frame, request, FetchInitiatorTypeNames::ping, 516 sendPingCommon(frame, request, FetchInitiatorTypeNames::ping,
517 AllowStoredCredentials, false); 517 AllowStoredCredentials, false);
518 } 518 }
519 519
520 void PingLoader::sendViolationReport(LocalFrame* frame, 520 void PingLoader::sendViolationReport(LocalFrame* frame,
521 const KURL& reportURL, 521 const KURL& reportURL,
522 PassRefPtr<EncodedFormData> report, 522 PassRefPtr<EncodedFormData> report,
523 ViolationReportType type) { 523 ViolationReportType type) {
524 ResourceRequest request(reportURL); 524 ResourceRequest request(reportURL);
525 request.setHTTPMethod(HTTPNames::POST); 525 request.setHTTPMethod(HTTPNames::POST);
526 request.setHTTPContentType(type == ContentSecurityPolicyViolationReport 526 switch (type) {
527 ? "application/csp-report" 527 case ContentSecurityPolicyViolationReport:
528 : "application/json"); 528 request.setHTTPContentType("application/csp-report");
529 break;
530 case XSSAuditorViolationReport:
531 request.setHTTPContentType("application/xss-auditor-report");
532 break;
533 }
529 request.setHTTPBody(std::move(report)); 534 request.setHTTPBody(std::move(report));
530 finishPingRequestInitialization(request, frame, 535 finishPingRequestInitialization(request, frame,
531 WebURLRequest::RequestContextCSPReport); 536 WebURLRequest::RequestContextCSPReport);
532 537
533 StoredCredentials credentialsAllowed = 538 StoredCredentials credentialsAllowed =
534 SecurityOrigin::create(reportURL)->isSameSchemeHostPort( 539 SecurityOrigin::create(reportURL)->isSameSchemeHostPort(
535 frame->document()->getSecurityOrigin()) 540 frame->document()->getSecurityOrigin())
536 ? AllowStoredCredentials 541 ? AllowStoredCredentials
537 : DoNotAllowStoredCredentials; 542 : DoNotAllowStoredCredentials;
538 sendPingCommon(frame, request, FetchInitiatorTypeNames::violationreport, 543 sendPingCommon(frame, request, FetchInitiatorTypeNames::violationreport,
(...skipping 30 matching lines...) Expand all
569 bool PingLoader::sendBeacon(LocalFrame* frame, 574 bool PingLoader::sendBeacon(LocalFrame* frame,
570 int allowance, 575 int allowance,
571 const KURL& beaconURL, 576 const KURL& beaconURL,
572 Blob* data, 577 Blob* data,
573 int& payloadLength) { 578 int& payloadLength) {
574 BeaconBlob beacon(data); 579 BeaconBlob beacon(data);
575 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 580 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
576 } 581 }
577 582
578 } // namespace blink 583 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/report-script-tag-replace-state-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698