MCPcopy
hub / github.com/di-sukharev/opencommit / processResponse

Method processResponse

out/cli.cjs:61792–61813  ·  view source on GitHub ↗
(response)

Source from the content-addressed store, hash-verified

61790 }
61791 r3.initiator = "fetch";
61792 r3.destination = "subresource";
61793 requestList.push(r3);
61794 const responsePromise = createDeferredPromise();
61795 fetchControllers.push(fetching({
61796 request: r3,
61797 dispatcher: getGlobalDispatcher(),
61798 processResponse(response) {
61799 if (response.type === "error" || response.status === 206 || response.status < 200 || response.status > 299) {
61800 responsePromise.reject(webidl.errors.exception({
61801 header: "Cache.addAll",
61802 message: "Received an invalid status code or the request failed."
61803 }));
61804 } else if (response.headersList.contains("vary")) {
61805 const fieldValues = getFieldValues(response.headersList.get("vary"));
61806 for (const fieldValue of fieldValues) {
61807 if (fieldValue === "*") {
61808 responsePromise.reject(webidl.errors.exception({
61809 header: "Cache.addAll",
61810 message: "invalid vary field value"
61811 }));
61812 for (const controller of fetchControllers) {
61813 controller.abort();
61814 }
61815 return;
61816 }

Callers 1

fetchFinaleFunction · 0.80

Calls 3

containsMethod · 0.80
getMethod · 0.45
abortMethod · 0.45

Tested by

no test coverage detected