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

Issue 2365353004: Add Content-Type header to net::ReportSender reports (Closed)

Created:
4 years, 2 months ago by estark
Modified:
4 years, 2 months ago
Reviewers:
Nathan Parker, eroman
CC:
chromium-reviews, cbentzel+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add Content-Type header to net::ReportSender reports Two sites that are opted into OCSP Expect-Staple reporting (www.dropbox.com, www.caddyserver.com) reported that they were receiving reports from Chrome with empty request bodies. This turned out to be their logging code not handling requests with no Content-Type header. When TransportSecurityState sends JSON violation reports for HPKP and Expect-Staple, it ought to be sending a Content-Type header of application/json. Thus, this CL adds a |content_type| parameter to net::ReportSender::Send() and updates the users of net::ReportSender (including TransportSecurityState) to set |content_type| appropriately. BUG=650327 Committed: https://crrev.com/b1716e2e3830aa031dc335b0403913efadb199dd Cr-Commit-Position: refs/heads/master@{#421459}

Patch Set 1 #

Patch Set 2 : update some unit test subclasses #

Total comments: 3

Patch Set 3 : make content type a required parameter to Send() #

Total comments: 6

Patch Set 4 : eroman comments #

Total comments: 9

Patch Set 5 : eroman comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -26 lines) Patch
M chrome/browser/safe_browsing/mock_permission_report_sender.h View 1 2 3 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/mock_permission_report_sender.cc View 1 2 3 2 chunks +8 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/permission_reporter.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/safe_browsing/permission_reporter_unittest.cc View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/ssl/chrome_expect_ct_reporter.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc View 1 2 3 2 chunks +8 lines, -2 lines 0 comments Download
M components/certificate_reporting/error_reporter.cc View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M components/certificate_reporting/error_reporter_unittest.cc View 1 2 3 2 chunks +10 lines, -2 lines 0 comments Download
M net/http/transport_security_state.h View 1 2 3 2 chunks +7 lines, -2 lines 0 comments Download
M net/http/transport_security_state.cc View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M net/http/transport_security_state_unittest.cc View 1 2 3 8 chunks +20 lines, -3 lines 0 comments Download
M net/url_request/report_sender.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M net/url_request/report_sender.cc View 1 2 3 4 2 chunks +10 lines, -2 lines 0 comments Download
M net/url_request/report_sender_unittest.cc View 1 2 6 chunks +18 lines, -4 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 4 chunks +11 lines, -2 lines 0 comments Download

Messages

Total messages: 40 (24 generated)
estark
eroman, PTAL?
4 years, 2 months ago (2016-09-26 18:32:50 UTC) #4
eroman
https://codereview.chromium.org/2365353004/diff/20001/net/http/transport_security_state.h File net/http/transport_security_state.h (right): https://codereview.chromium.org/2365353004/diff/20001/net/http/transport_security_state.h#newcode260 net/http/transport_security_state.h:260: virtual void SetContentTypeHeader(const std::string& content_type) = 0; API question: ...
4 years, 2 months ago (2016-09-26 18:37:24 UTC) #5
estark
https://codereview.chromium.org/2365353004/diff/20001/net/http/transport_security_state.h File net/http/transport_security_state.h (right): https://codereview.chromium.org/2365353004/diff/20001/net/http/transport_security_state.h#newcode260 net/http/transport_security_state.h:260: virtual void SetContentTypeHeader(const std::string& content_type) = 0; On 2016/09/26 ...
4 years, 2 months ago (2016-09-26 18:38:45 UTC) #6
eroman
https://codereview.chromium.org/2365353004/diff/20001/net/http/transport_security_state.h File net/http/transport_security_state.h (right): https://codereview.chromium.org/2365353004/diff/20001/net/http/transport_security_state.h#newcode260 net/http/transport_security_state.h:260: virtual void SetContentTypeHeader(const std::string& content_type) = 0; On 2016/09/26 ...
4 years, 2 months ago (2016-09-26 18:55:11 UTC) #9
estark
On 2016/09/26 18:55:11, eroman wrote: > https://codereview.chromium.org/2365353004/diff/20001/net/http/transport_security_state.h > File net/http/transport_security_state.h (right): > > https://codereview.chromium.org/2365353004/diff/20001/net/http/transport_security_state.h#newcode260 > ...
4 years, 2 months ago (2016-09-26 18:59:43 UTC) #10
eroman
sure sgtm On Mon, Sep 26, 2016 at 11:59 AM, <estark@chromium.org> wrote: > On 2016/09/26 ...
4 years, 2 months ago (2016-09-26 19:28:03 UTC) #11
estark
Ok, I updated the CL to add |content_type| as a parameter to Send() -- PTAL. ...
4 years, 2 months ago (2016-09-26 19:58:17 UTC) #15
eroman
lgtm https://codereview.chromium.org/2365353004/diff/40001/chrome/browser/ssl/chrome_expect_ct_reporter.cc File chrome/browser/ssl/chrome_expect_ct_reporter.cc (right): https://codereview.chromium.org/2365353004/diff/40001/chrome/browser/ssl/chrome_expect_ct_reporter.cc#newcode179 chrome/browser/ssl/chrome_expect_ct_reporter.cc:179: report_sender_->Send(report_uri, "application/json", serialized_report); What is your take on ...
4 years, 2 months ago (2016-09-26 21:14:07 UTC) #16
estark
Thanks, Eric. Adding nparker: can you please take a look at changes to chrome/browser/safe_browsing? https://codereview.chromium.org/2365353004/diff/40001/chrome/browser/ssl/chrome_expect_ct_reporter.cc ...
4 years, 2 months ago (2016-09-26 23:26:10 UTC) #23
eroman
lgtm https://codereview.chromium.org/2365353004/diff/60001/net/url_request/report_sender.cc File net/url_request/report_sender.cc (right): https://codereview.chromium.org/2365353004/diff/60001/net/url_request/report_sender.cc#newcode56 net/url_request/report_sender.cc:56: new std::vector<char>(report.data(), report.data() + report.length()))); nit: For terser ...
4 years, 2 months ago (2016-09-26 23:40:55 UTC) #24
Nathan Parker
LGTM for safe_browsing Mine are all nits, do what you can with them. https://codereview.chromium.org/2365353004/diff/60001/components/certificate_reporting/error_reporter.cc File ...
4 years, 2 months ago (2016-09-26 23:53:25 UTC) #25
eroman
https://codereview.chromium.org/2365353004/diff/60001/net/url_request/report_sender.cc File net/url_request/report_sender.cc (right): https://codereview.chromium.org/2365353004/diff/60001/net/url_request/report_sender.cc#newcode38 net/url_request/report_sender.cc:38: DCHECK(!content_type.empty()); On 2016/09/26 23:53:25, Nathan Parker wrote: > Can ...
4 years, 2 months ago (2016-09-27 00:03:34 UTC) #26
estark
https://codereview.chromium.org/2365353004/diff/60001/components/certificate_reporting/error_reporter.cc File components/certificate_reporting/error_reporter.cc (right): https://codereview.chromium.org/2365353004/diff/60001/components/certificate_reporting/error_reporter.cc#newcode142 components/certificate_reporting/error_reporter.cc:142: certificate_report_sender_->Send(upload_url_, "application/octet-stream", On 2016/09/26 23:53:25, Nathan Parker wrote: > ...
4 years, 2 months ago (2016-09-27 04:05:20 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2365353004/80001
4 years, 2 months ago (2016-09-28 05:08:01 UTC) #36
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 2 months ago (2016-09-28 06:04:07 UTC) #38
commit-bot: I haz the power
4 years, 2 months ago (2016-09-28 06:06:11 UTC) #40
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/b1716e2e3830aa031dc335b0403913efadb199dd
Cr-Commit-Position: refs/heads/master@{#421459}

Powered by Google App Engine
This is Rietveld 408576698