Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorization headers always sent #35

Closed
rbot09 opened this issue Aug 25, 2021 · 3 comments
Closed

Authorization headers always sent #35

rbot09 opened this issue Aug 25, 2021 · 3 comments

Comments

@rbot09
Copy link

rbot09 commented Aug 25, 2021

Hi, first of all thanks for the plugin its great!,

I encounter a problem while using azure blobs for download weather I send basicAuth as null or not, seams like the request headers authorization: 'Basic bnVsbA==' are always sent. I believe In FileDownloader.java:46
if (basicAuth != null) { basicAuth = new String(Base64.encode(basicAuth.getBytes(), Base64.NO_WRAP)); connection.setRequestProperty("Authorization", "Basic " + basicAuth); }
basicAuth is not null all the time.

I did a test server to intercept both download examples below and the authorization header is always present causing issues with strict servers.

await window.ApkUpdater.download('http://192.168.1.14:8000/update.apk', { basicAuth: null, onDownloadProgress: (e) => { console.log(Downloading: ${e.progress} % (${e.bytesWritten} / ${e.bytes})`)
}
})

await window.ApkUpdater.download('http://192.168.1.14:8000/update.apk', {
onDownloadProgress: (e) => {
this.enforce_upgrade.download_progress = e.progress
console.log(Downloading: ${e.progress} % (${e.bytesWritten} / ${e.bytes}))
console.log(this.enforce_upgrade)
}
})

{
authorization: 'Basic bnVsbA==',
'user-agent': 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; TC20 Build/01-11-09.00-OG-U00-H01)',
host: '192.168.1.14:8000',
connection: 'Keep-Alive',
'accept-encoding': 'gzip'
}
`

@kolbasa
Copy link
Owner

kolbasa commented Aug 25, 2021

I just checked. Yes, you are right. That is a bug.
I'll fix it right now.

@kolbasa
Copy link
Owner

kolbasa commented Aug 25, 2021

Bugfix is now released with version: 2.6.1

@rbot09
Copy link
Author

rbot09 commented Aug 25, 2021

This is working now thanks!

@rbot09 rbot09 closed this as completed Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants