Open FreeBishop opened 2 years ago
Also ran into this issue. Ideally the updater would implement a single callback to allow request signing across all HTTP requests.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I currently have an app that I am able to upload to my private S3 bucket and can properly check for updates and download them. While my app is able to download and install updates, in my logs I can see this error that other developers seem to face:
// Start of Context \\ Ideally, I want to use differential downloading with blockmaps to reduce the download payload. Right now it works, but users have to reinstall the entire app.
I've configured my own signing for AWS API Requests so that I can take my
Authorization
headers and change theautoUpdater.requestHeaders
for the outgoing request for the.exe
andlatest.yml
.When I call
autoUpdater.downloadUpdate()
I see it makes a call to download both the old and new blockmap of the app version:The function I use to create my AWS signature and attach the request headers is called before
autoUpdater.checkForUpdates()
andautoUpdater.downloadUpdate()
. Since the downloading portion will ping my S3 bucket twice for the blockmaps, I understand that I would need to make two separate AWS signatures to allow access to those resources. However, I can only change theautoUpdater.requestHeaders
for one resource at a time before it makes the fetch call to both blockmaps in the bucket.I checked through electron-updater files and can see in
NsisUpdater.ts
that this function is responsible for downloading the blockmaps: https://github.com/electron-userland/electron-builder/blob/70c35176e452ee3159196edabaf685337a09cb82/packages/electron-updater/src/NsisUpdater.ts#L142-L147It will use the same request header that is set for both blockmap calls. // End of Context \\
My question is if it's possible to change the request headers of the autoUpdater, for both blockmaps, before their respective fetch call is made. I can currently only sign for one blockmap, but then differential downloading ultimately fails since that same AWS signature is invalid for the other blockmap.
Please let me know if any more context is needed and thank you all for your time.