|
|
@@ -54,18 +54,17 @@
|
|
|
return { responseId, headers };
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if (request.method == "fetch.array") {
|
|
|
- const content = fetchResponses.get(request.requestId);
|
|
|
- fetchResponses.delete(request.requestId);
|
|
|
- const buffer = await content.arrayBuffer();
|
|
|
- return { array: Array.from(new Uint8Array(buffer)) };
|
|
|
- }
|
|
|
- if (request.method == "fetch.text") {
|
|
|
+ } else {
|
|
|
const content = fetchResponses.get(request.requestId);
|
|
|
fetchResponses.delete(request.requestId);
|
|
|
- const text = await content.text();
|
|
|
- return { text };
|
|
|
+ if (request.method == "fetch.array") {
|
|
|
+ const buffer = await content.arrayBuffer();
|
|
|
+ return { array: Array.from(new Uint8Array(buffer)) };
|
|
|
+ }
|
|
|
+ if (request.method == "fetch.text") {
|
|
|
+ const text = await content.text();
|
|
|
+ return { text };
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|