(_0)
| 16029 | message: "Expected an http/s scheme when method is not GET" |
| 16030 | }); |
| 16031 | } |
| 16032 | const innerResponse = response[kState]; |
| 16033 | if (innerResponse.status === 206) { |
| 16034 | throw webidl.errors.exception({ |
| 16035 | header: prefix, |
| 16036 | message: "Got 206 status" |
| 16037 | }); |
| 16038 | } |
| 16039 | if (innerResponse.headersList.contains("vary")) { |
| 16040 | const fieldValues = getFieldValues(innerResponse.headersList.get("vary")); |
| 16041 | for (const fieldValue of fieldValues) { |
| 16042 | if (fieldValue === "*") { |
| 16043 | throw webidl.errors.exception({ |
| 16044 | header: prefix, |
| 16045 | message: "Got * vary field value" |
| 16046 | }); |
| 16047 | } |
| 16048 | } |
| 16049 | } |
| 16050 | if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { |
| 16051 | throw webidl.errors.exception({ |
| 16052 | header: prefix, |
| 16053 | message: "Response body is locked or disturbed" |
| 16054 | }); |
| 16055 | } |
| 16056 | const clonedResponse = cloneResponse(innerResponse); |
| 16057 | const bodyReadPromise = createDeferredPromise(); |
| 16058 | if (innerResponse.body != null) { |
| 16059 | const stream = innerResponse.body.stream; |
| 16060 | const reader = stream.getReader(); |
| 16061 | readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); |
| 16062 | } else { |
| 16063 | bodyReadPromise.resolve(void 0); |
| 16064 | } |
| 16065 | const operations = []; |
| 16066 | const operation = { |
| 16067 | type: "put", |
| 16068 | // 14. |
| 16069 | request: innerRequest, |
| 16070 | // 15. |
| 16071 | response: clonedResponse |
| 16072 | // 16. |
| 16073 | }; |
| 16074 | operations.push(operation); |
| 16075 | const bytes = yield bodyReadPromise.promise; |
no test coverage detected