Skip to content

Commit

Permalink
fix: remove host property from headers when signed by aws4.sign (#4848)
Browse files Browse the repository at this point in the history
Close #4758
  • Loading branch information
ameer-clara committed Apr 5, 2020
1 parent 37a17f2 commit 0f0363b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/electron-updater/src/electronHttpExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ export class ElectronHttpExecutor extends HttpExecutor<Electron.ClientRequest> {
}

createRequest(options: any, callback: (response: any) => void): any {

// fix (node 7+) for making electron updater work when using AWS private buckets, check if headers contain Host property
if (options.headers && options.headers.Host){
// set host value from headers.Host
options.host = options.headers.Host
// remove header property 'Host', if not removed causes net::ERR_INVALID_ARGUMENT exception
delete options.headers.Host;
}

// differential downloader can call this method very often, so, better to cache session
if (this.cachedSession == null) {
this.cachedSession = getNetSession()
Expand Down

0 comments on commit 0f0363b

Please sign in to comment.