Re: [whatwg/fetch] Should request's origin be exposed to javascript (#272)

I think origin belongs on the event for a couple reasons:

1) We already expose the origin on ExtendedMessageEvent, so there is precedence.
2) A Request can theoretically be constructed in one origin and passed to fetch() in another origin.  Would the Request.origin be the origin of construction or something added by the browser when fetch() is invoked?  What if a ForeignFetchEvent.request is serialized to Cache, then later pulled back out and used in a new fetch()?  What would its origin be then?  We could figure all this out, but I think it would be easier to just put the origin on the event.

Overall the FetchEvent and ForeignFetchEvent objects are our way of exposing to script that a network request.  Assuming that we care about the origin of the code initiating the request, then I think it makes the most sense to keep the origin on those events.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/272#issuecomment-205549028

Received on Monday, 4 April 2016 23:52:56 UTC