Skip to content

Commit c8a91ed

Browse files
committed
WIP report-url
1 parent 9eed763 commit c8a91ed

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

api.bs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,9 +1999,10 @@ set on a response requesting that the user agent invoke the
19991999
<a method for=Attribution>measureConversion()</a> API.
20002000

20012001
<div class=example id=ex-measure-conversion-header>
2002-
This is the HTTP equivalent of <a href=#ex-measure-conversion>the JavaScript `measureConversion` example</a>:
2002+
This is the HTTP equivalent of <a href=#ex-measure-conversion>the JavaScript `measureConversion` example</a>,
2003+
with the addition of a `report-url` to which the resulting report will be `POST`ed:
20032004
<xmp highlight=http>
2004-
Measure-Conversion: aggregation-service="https://aggregator.example/tee", histogram-size=20, epsilon=1.0, lookback-days=14, impression-sites=("publisher.example" "other.example"), impression-callers=("ad-tech.example"), match-values=(2), credit=(0.25 0.25 0.5), value=3, max-value=7
2005+
Measure-Conversion: aggregation-service="https://aggregator.example/tee", histogram-size=20, epsilon=1.0, lookback-days=14, impression-sites=("publisher.example" "other.example"), impression-callers=("ad-tech.example"), match-values=(2), credit=(0.25 0.25 0.5), value=3, max-value=7, report-url="https://report-handler.example/foo"
20052006
</xmp>
20062007
</div>
20072008

@@ -2070,13 +2071,18 @@ optional keys are populated the same way as the corresponding
20702071
Value of <a dict-member for=AttributionConversionOptions>maxValue</a>,
20712072
a positive [=structured header/integer=]. This key is optional.
20722073
</dd>
2074+
<dt><dfn noexport><code>report-url</code></dfn></dt>
2075+
<dd>
2076+
A [=structured header/string=] containing the [=potentially trustworthy URL=]
2077+
to which the resulting report, if any, will be `POST`ed. The URL may be
2078+
relative to the request URL, and its [=url/scheme=] must be "`http`" or "`https`".
2079+
This key is required.
2080+
</dd>
20732081
</dl>
20742082

2075-
Issue: Add a required field indicating where to send the resulting report.
2076-
20772083
<div algorithm>
20782084
To <dfn noexport>parse a `Measure-Conversion` header</dfn> given a [=header value=]
2079-
|input|, run these steps:
2085+
|input| and [=URL=] |baseUrl|, run these steps:
20802086

20812087
1. Let |dict| be the result of [=structured header/parsing structured fields=]
20822088
with <var ignore>input_bytes</var> set to |input| and
@@ -2086,6 +2092,12 @@ To <dfn noexport>parse a `Measure-Conversion` header</dfn> given a [=header valu
20862092
1. If |aggregationService| is not a [=structured header/string=], return an error.
20872093
1. Let |histogramSize| be |dict|["<code>[=measure-conversion/histogram-size=]</code>"] [=map/with default=] `undefined`.
20882094
1. If |histogramSize| is not a positive [=structured header/integer=], return an error.
2095+
1. Let |reportUrlString| be |dict|["<code>[=measure-conversion/report-url=]</code>"] [=map/with default=] `undefined`.
2096+
1. If |reportUrlString| is not a [=structured header/string=], return an error.
2097+
1. Let |reportUrl| be the result of applying the [=URL parser=] to |reportUrlString|, with |baseUrl|.
2098+
1. If |reportUrl| is failure, return an error.
2099+
1. If |reportUrl| is not a [=potentially trustworthy URL=], return an error.
2100+
1. If |reportUrl|'s [=url/scheme=] is not "`http`" or "`https`", return an error.
20892101
1. Let |opts| be a new {{AttributionConversionOptions}} with the following items:
20902102
: {{AttributionConversionOptions/aggregationService}}
20912103
:: |aggregationService|
@@ -2133,6 +2145,8 @@ To <dfn noexport>parse a `Measure-Conversion` header</dfn> given a [=header valu
21332145
1. Set |opts|.{{AttributionConversionOptions/maxValue}} to |maxValue|.
21342146
1. Return |opts|.
21352147

2148+
Issue: Propagate |reportUrl| so that it can be used to send the resulting report.
2149+
21362150
</div>
21372151

21382152

0 commit comments

Comments
 (0)