Skip to content

Commit

Permalink
RFC6265bis: Offload Service Worker SFC computation to spec (#2217)
Browse files Browse the repository at this point in the history
* Offload Service Worker SFC computation to spe

This changes how 6265bis computes the Site for Cookies for
Service Workers by referring to their spec instead of spelling
it out locally.

* Add to change log

* Offload Service Worker SFC computation to spe

This changes how 6265bis computes the Site for Cookies for
Service Workers by referring to their spec instead of spelling
it out locally.

* Add to change log
  • Loading branch information
sbingler authored Jul 27, 2022
1 parent f0fbfa7 commit 756f17c
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions draft-ietf-httpbis-rfc6265bis.md
Original file line number Diff line number Diff line change
Expand Up @@ -1088,20 +1088,8 @@ Service Workers are more complicated, as they act as a completely separate
execution context with only tangential relationship to the Document which
registered them.

Requests which simply pass through a Service Worker will be handled as described
above: the request's client will be the Document or Worker which initiated the
request, and its "site for cookies" will be those defined in
{{document-requests}} and {{dedicated-and-shared-requests}}

Requests which are initiated by the Service Worker itself (via a direct call to
`fetch()`, for instance), on the other hand, will have a client which is a
ServiceWorkerGlobalScope. Its "site for cookies" will be the Service Worker's
URI's origin.

Given a ServiceWorkerGlobalScope (`worker`), the following algorithm returns its
"site for cookies":

1. Return `worker`'s origin.
How user agents handle Service Workers may differ, but user agents SHOULD
match the {{SERVICE-WORKERS}} specification.

## Ignoring Set-Cookie Header Fields {#ignoring-cookies}

Expand Down Expand Up @@ -2519,6 +2507,9 @@ The "Cookie Attribute Registry" should be created with the registrations below:
* Add warning to not send nameless cookies:
<https://github.com/httpwg/http-extensions/pull/2220>

* Add note regarding Service Worker's computation of "site for cookies":
<https://github.com/httpwg/http-extensions/pull/2217>

# Acknowledgements
{:numbered="false"}
RFC 6265 was written by Adam Barth. This document is an update of RFC 6265,
Expand Down

0 comments on commit 756f17c

Please sign in to comment.