Skip to content

Commit 59dbc3e

Browse files
committed
Switch from USVString to Blob for body content.
1 parent 876155f commit 59dbc3e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

extension/src/bg/background.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ async function perform_http_request(params) {
207207
// If there is a request body, we decode it
208208
// and set it for the request.
209209
if (params.body) {
210-
request_options.body = atob(params.body);
210+
// This is a hack to convert base64 to a Blob
211+
const fetchURL = `data:application/octet-stream;base64,${params.body}`;
212+
const fetchResp = await fetch(fetchURL);
213+
request_options.body = await fetchResp.blob();
211214
}
212215

213216
try {

0 commit comments

Comments
 (0)