diff --git a/fetch.bs b/fetch.bs index a260d34c7..2524f80d4 100644 --- a/fetch.bs +++ b/fetch.bs @@ -3635,24 +3635,48 @@ steps:
This standardizes the error handling for servers that violate HTTP.
If response is not a network error and request's - integrity metadata is not the empty string, then: +
If request's integrity metadata is not the empty string, then:
If response's body's stream has not - errored, and response does not - match - request's integrity metadata, set response and - internalResponse to a network error. - [[!SRI]] +
Let processError be this step: run fetch finale given + fetchParams and a network error. + + +
If request's response tainting is "opaque
" or
+ response is a network error, then run processError and abort these
+ steps.
+
+
Let processBody given bytes be these steps: + +
If bytes do not + match + request's integrity metadata, then run processError + and abort these steps. [[!SRI]] + +
Let body and ignoreType be the result of + safely extracting bytes. + +
Set response's body to body. + +
Run fetch finale given fetchParams and response. +
Fully read response's body given + processBody and with processError set to + processError.
This operates on response as this algorithm is not supposed to observe - internalResponse. That would allow an attacker to use hashes as an oracle. +
Otherwise, run fetch finale given fetchParams and response. + + +
The fetch finale, given a fetch params fetchParams and a +response response, run these steps: +
If fetchParams's process response is non-null, then: