Skip to content

Commit

Permalink
fix #1977: chunk may be ""
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Dec 7, 2023
1 parent 8ddee2c commit d5c482d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/background/utils/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function xhrCallbackWrapper(req, events, blobbed, chunked, isJson) {
...objectPick(xhr, SEND_XHR_PROPS),
...objectPick(evt, SEND_PROGRESS_PROPS),
[kResponse]: shouldSendResponse
? numChunks && await getChunk(response, 0, chunkSize) || response
? (numChunks ? await getChunk(response, 0, chunkSize) : response)
: null,
[kResponseHeaders]: responseHeaders !== (tmp = getResponseHeaders())
? (responseHeaders = tmp)
Expand Down
2 changes: 1 addition & 1 deletion src/injected/content/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ addBackgroundHandlers({
return;
}
let response = data?.[kResponse];
if (response) {
if (response != null) {
if (msg.blobbed) {
response = await importBlob(req, response);
} else if (msg.chunked) {
Expand Down

0 comments on commit d5c482d

Please sign in to comment.