silkimen / cordova-plugin-advanced-http

Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!
MIT License
391 stars 313 forks source link

[ Failed to construct 'Blob':] [Android] "advanced-http: an error occured during post processing response:..." #481

Closed kernel-debugger closed 11 months ago

kernel-debugger commented 1 year ago

Describe the bug I'm making parallel range requests (10+) using this plugin with responseType option set to blob, some requests complete successfully while some fail with the following message "advanced-http: an error occured during post processing response: Failed to construct 'Blob': The provided value is not of type 'BlobPropertyBag'."

Tried setting responseType to "arraybuffer", but it made no difference.

I get no error on browser, this is specific to android (not tested on ios)

System info

Are you using ionic-native-wrapper? NO, I'm using Cordova.

Minimum viable code to reproduce Like I said, not every request fails, but this is the basic code.

 cordova.plugin.http.sendRequest("http://example.com", {
    method:"get",
    responseType:"blob",
    headers:{
        "Range": "bytes="+1024+"-"+10024
    }}, console.log, console.log);

Screenshots Screenshot_2022-09-26_12-36-19

kernel-debugger commented 1 year ago

The problem was in my success callback.

silkimen commented 11 months ago

Thanks for the feedback, closing this, feel free to open a new issue, if this won't solve your problem! 👍