w3c / reporting

Reporting API
https://w3c.github.io/reporting/
Other
76 stars 36 forks source link

Fetch integration: missing at least "method" when creating a request #232

Closed zcorpan closed 3 years ago

zcorpan commented 3 years ago

https://w3c.github.io/reporting/#try-delivery says

Let request be a new request with the following properties [FETCH]:

and doesn't list "method", so the request will use the default value which is GET.

Given https://w3c.github.io/reporting/#media-type and https://w3c.github.io/reporting/#sample-reports it seems the intention is to set the method to POST.

Are there other properties of "request" that should be set but aren't? I'm not too familiar with all of them, maybe @annevk can help?

clelland commented 3 years ago

It definitely should be a POST, that seems to have been an oversight from when the fetch mechanics were spelled out, way back in b50790acc9a1b39e7febae1fe0771215cbfdca3c.

clelland commented 3 years ago

Other properties I can see that might be useful or important: "cache-mode", "use-cors-preflight", "referrer", "keepalive". I'm not sure how or if each of them should be set, though, without some more reading.

zcorpan commented 3 years ago

Yeah, "keepalive" is one I thought probably should be set, but I also have more questions about how the delaying of sending reports is supposed to work. I'll report a separate issue about that.

annevk commented 3 years ago

keepalive does have a number of limitations and we didn't consider reports when designing it so there might be more work required there. I don't think any of the other properties identified would need to be set here (note that referrer has appropriate defaulting).

clelland commented 3 years ago

Merging this, then, and we can follow up about keepalive on the other issue.