From f83298a0aff18cf16d569160c65ae540d3bc3f40 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 26 Nov 2017 16:08:29 +0100 Subject: [PATCH] fix(download): remove the ghToken for binary download The github token is only needed for the API access and will confuse amazon S3 when it is passed to the download: ``` \nInvalidArgumentOnly one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specifiedAuthorizationtoken herebesecrettoken7CCDB87CF1347C29xyyeVP5ImwDePFMXAZheNYLnXQBsVCka4U6KLWKCjynHNpQZxzfBdl4sRfUbORSul8c8YNwux8w= ``` Refs #425 --- src/compiler.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler.ts b/src/compiler.ts index ff3b7ab..ce371c5 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -196,6 +196,8 @@ export class NexeCompiler { throw new Error(`${assetName} not available, create it using the --build flag`) } const filename = this.getNodeExecutableLocation(target) + // Remove the authorization, as the download is done via amazon S3 and does not need the token + delete downloadOptions.headers.Authorization await download(asset.browser_download_url, dirname(filename), downloadOptions).on( 'response', (res: IncomingMessage) => {