Re: [whatwg/fetch] Perform a CSP check when consuming preloaded response (PR #1411)

@noamr commented on this pull request.



> @@ -3855,9 +3858,12 @@ the request.
    with <var>request</var>'s <a for=request>client</a>'s
    <a for="environment settings object">origin</a>.
 
+   <li><p>Set <var>fetchParams</var>'s <a for="fetch params">preloaded response candidate</a> to
+   "<code>pending</code>".

> How about instead of having this step, we only set state to "pending" in the last step if _foundPreloadedResource_ is true? Although I guess we'd have to make sure it's not a response already in case it was all available synchronously.
> 
> 
> 
> So you'd get
> 
> 
> 
> > If _foundPreloadedResource_ is true and _fetchParams_'s preloaded response candidate is null, set _fetchParams_'s preloaded response candidate to "pending".
> 
> 
> 
> That seems a little clearer to me.

Sure, I did it this way because of the synchronous case but your proposal handles it more readably 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1411#discussion_r827873625
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1411/review/911437335@github.com>

Received on Wednesday, 16 March 2022 10:52:49 UTC