From 48fb1fefa2a325666ed73e08e749317c95903218 Mon Sep 17 00:00:00 2001 From: amottier Date: Thu, 20 Jun 2019 15:26:16 +0200 Subject: [PATCH] fix upload headers --- deploy/lib/uploadCode.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/deploy/lib/uploadCode.js b/deploy/lib/uploadCode.js index 8c8f0966..c5b81d70 100644 --- a/deploy/lib/uploadCode.js +++ b/deploy/lib/uploadCode.js @@ -25,7 +25,8 @@ module.exports = { return this.provider.apiManager.get(`/functions/${func.id}/upload-url?content_length=${archiveSize}`) .then(response => Object.assign(func, { uploadUrl: response.data.url, - uploadHeader: response.data.headers, + uploadHeader: {'content_length': archiveSize, + 'Content-Type': 'application/octet-stream'} })); }); @@ -50,9 +51,7 @@ module.exports = { data, method: 'put', url: func.uploadUrl, - headers: Object.assign(func.uploadHeader, { - 'Content-Type': 'application/octet-stream', - }), + headers: func.uploadHeader, maxContentLength: 1000000000, })); });