Skip to content

Commit 764f599

Browse files
Merge pull request #86 from apasel422/issue-81
Reject zero as a value for impression lifetime
2 parents 6c62fa3 + ad3019c commit 764f599

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Diff for: api.bs

+11-5
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ The arguments to <a method for=PrivateAttribution>saveImpression()</a> are as fo
515515
site.
516516
<dt><dfn>lifetimeDays</dfn></dt>
517517
<dd>
518-
A "time to live" (in days) after which the [=impression=] can no longer
519-
receive attribution.
518+
A non-zero "time to live" (in days) after which the [=impression=] can no
519+
longer receive attribution.
520520
If not specified, the default is 30 days.
521521
The [=user agent=] should impose an upper limit on the lifetime,
522522
and silently reduce the value specified here if it exceeds that limit.
@@ -525,11 +525,17 @@ The arguments to <a method for=PrivateAttribution>saveImpression()</a> are as fo
525525

526526
### Operation ### {#save-impression-api-operation}
527527

528+
Given <a dictionary lt=PrivateAttributionImpressionOptions>|options|</a>:
529+
528530
1. Collect the implicit API inputs:
529531
1. The current timestamp
530-
2. The impression site domain
531-
3. The iframe site domain
532-
1. Validate the page-supplied API inputs
532+
1. The impression site domain
533+
1. The iframe site domain
534+
1. Validate the page-supplied API inputs:
535+
1. If |options|.{{PrivateAttributionImpressionOptions/lifetimeDays}} is 0,
536+
throw a {{RangeError}}.
537+
1. Clamp |options|.{{PrivateAttributionImpressionOptions/lifetimeDays}} to
538+
the [=user agent=]'s upper limit.
533539
1. If the private attribution API is enabled, save the impression to the
534540
[=impression store=].
535541

0 commit comments

Comments
 (0)