presidium 1.4.9 → 1.4.10

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/Readable.js CHANGED
@@ -35,8 +35,12 @@ const Readable = {}
35
35
  Readable.Buffer = function Readable(readable) {
36
36
  return new Promise((resolve, reject) => {
37
37
  const chunks = []
38
- readable.on('data', chunk => {
39
- chunks.push(chunk)
38
+ readable.on('data', (chunk, encoding) => {
39
+ if (typeof chunk == 'string') {
40
+ chunks.push(Buffer.from(chunk, encoding))
41
+ } else {
42
+ chunks.push(chunk)
43
+ }
40
44
  })
41
45
  readable.on('end', () => {
42
46
  resolve(Buffer.concat(chunks))
package/S3Bucket.js CHANGED
@@ -870,6 +870,9 @@ class S3Bucket {
870
870
  headers['Content-Length'] = options.ContentLength
871
871
  }
872
872
 
873
+ if (body.readable) {
874
+ body = await Readable.Buffer(body)
875
+ }
873
876
  if (options.ContentMD5) {
874
877
  headers['Content-MD5'] = options.ContentMD5
875
878
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presidium",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "description": "A library for creating web services",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",