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

Side by Side Diff: chrome/browser/ssl/chrome_expect_ct_reporter.cc

Issue 2365353004: Add Content-Type header to net::ReportSender reports (Closed)
Patch Set: make content type a required parameter to Send() Created 4 years, 2 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h" 5 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 report.Set("valid-scts", std::move(valid_scts)); 169 report.Set("valid-scts", std::move(valid_scts));
170 170
171 std::string serialized_report; 171 std::string serialized_report;
172 if (!base::JSONWriter::Write(report, &serialized_report)) { 172 if (!base::JSONWriter::Write(report, &serialized_report)) {
173 LOG(ERROR) << "Failed to serialize Expect CT report"; 173 LOG(ERROR) << "Failed to serialize Expect CT report";
174 return; 174 return;
175 } 175 }
176 176
177 UMA_HISTOGRAM_BOOLEAN("SSL.ExpectCTReportSendingAttempt", true); 177 UMA_HISTOGRAM_BOOLEAN("SSL.ExpectCTReportSendingAttempt", true);
178 178
179 report_sender_->Send(report_uri, serialized_report); 179 report_sender_->Send(report_uri, "application/json", serialized_report);
eroman 2016/09/26 21:14:07 What is your take on using "application/json; char
estark 2016/09/26 23:26:10 Sure, that seems reasonable. Done.
180 } 180 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698