Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect current User-Agent when queueing a report #96

Merged
merged 3 commits into from
Jun 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ <h1>Reporting API</h1>
type: dfn
text: origin
text: top-level browsing context
urlPrefix: system-state.html
type: dfn
text: navigator.userAgent; url: dom-navigator-useragent
spec: RFC3986; urlPrefix: https://tools.ietf.org/html/rfc3986
type: grammar
text: absolute-uri; url: section-4.3
Expand Down Expand Up @@ -333,6 +336,17 @@ <h3 id="concept-reports">Reports</h3>
Each <a>report</a> has an <dfn for="report" export>origin</dfn>,
which is an <a spec="html">origin</a> representing the report's initiator.

Each <a>report</a> has a <dfn for="report" export>user agent</dfn>, which is
the value of the <code>User-Agent</code> <a>header</a> of the <a>request</a>
from which the report was generated.

Note: The <a for="report">user agent</a> of a <a>report</a> represents the
<code>User-Agent</code> sent by the browser for the page which generated the
<a>report</a>. This is potentially distinct from the <code>User-Agent</code>
sent in the HTTP headers when uploading the report to a collector — for
instance, where the browser has chosen to use a non-default
<code>User-Agent</code> string such as the "request desktop site" feature.

Each <a>report</a> has a <dfn for="report" export>group</dfn>,
which is a string representing the {{endpoint group/name}} of the
<a spec="html">origin</a>'s <a>endpoint group</a> that the report will be sent
Expand Down Expand Up @@ -634,6 +648,8 @@ <h3 id="queue-report" algorithm>
:: |data|
: [=report/origin=]
:: |settings|'s <a spec="html">origin</a>
: [=report/user agent=]
:: The current value of <a><code>navigator.userAgent</code></a>
: [=report/group=]
:: |endpoint group|
: [=report/type=]
Expand Down Expand Up @@ -842,6 +858,8 @@ <h3 id="try-delivery" algorithm>
:: |report|'s [=report/type=]
: `url`
:: |report|'s [=report/url=]
: `user_agent`
:: |report|'s [=report/user agent=]
: `body`
:: |report|'s [=report/body=]

Expand Down Expand Up @@ -1242,6 +1260,7 @@ <h2 id="sample-reports">Sample Reports</h2>
"type": "csp",
"age": 10,
"url": "https://example.com/vulnerable-page/",
"user_agent": "ReportingSpec/1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit confusing and easy to misinterpret as version of reporting API. Perhaps use a real-world UA string as an example?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#98

"body": {
"blocked": "https://evil.com/evil.js",
"directive": "script-src",
Expand All @@ -1253,6 +1272,7 @@ <h2 id="sample-reports">Sample Reports</h2>
"type": "hpkp",
"age": 32,
"url": "https://www.example.com/",
"user_agent": "ReportingSpec/1",
"body": {
"date-time": "2014-04-06T13:00:50Z",
"hostname": "www.example.com",
Expand All @@ -1274,6 +1294,7 @@ <h2 id="sample-reports">Sample Reports</h2>
"type": "nel",
"age": 29,
"url": "https://example.com/thing.js",
"user_agent": "ReportingSpec/1",
"body": {
"referrer": "https://www.example.com/",
"server-ip": "234.233.232.231",
Expand Down