configurapi-runner-lambda-api 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "configurapi-runner-lambda-api",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A lambda runner for configurapi.",
5
5
  "bin": {
6
6
  "configurapi-runner-lambda-api": "src/index.js"
@@ -13,7 +13,7 @@ module.exports = {
13
13
 
14
14
  if(response.body instanceof Buffer)
15
15
  {
16
- body = response.body;
16
+ body = response.body.toString('base64');
17
17
  }
18
18
  else if(response.body instanceof String || typeof response.body === 'string')
19
19
  {
@@ -40,7 +40,7 @@ module.exports = {
40
40
  headers: response.headers,
41
41
  body: body,
42
42
  statusDescription: `${response.statusCode} ${status[response.statusCode]}`,
43
- isBase64Encoded: false,
43
+ isBase64Encoded: response.body instanceof Buffer,
44
44
  multiValueHeaders: Object.keys(response.headers).reduce((memo, k) => {
45
45
  memo[k] = [response.headers[k]];
46
46
  return memo;
@@ -50,7 +50,8 @@ module.exports = {
50
50
  return {
51
51
  statusCode: response.statusCode,
52
52
  headers: response.headers,
53
- body: body
53
+ body: body,
54
+ isBase64Encoded: response.body instanceof Buffer
54
55
  };
55
56
  },
56
57