Skip to content

Commit

Permalink
fix: uploadAsset with file: fs.createReadStream()
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Dec 25, 2017
1 parent da35582 commit 85255a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var HttpsProxyAgent = require('https-proxy-agent')
var getProxyForUrl = require('proxy-from-env').getProxyForUrl
var isStream = require('is-stream')
var toCamelCase = require('lodash/camelCase')
var urlTemplate = require('url-template')

Expand Down Expand Up @@ -777,6 +778,10 @@ var Client = module.exports = function (config) {
}

if (hasFileBody) {
if (isStream(msg.file)) {
return msg.file.pipe(req)
}

req.write(Buffer.from(msg.file))
}

Expand Down

0 comments on commit 85255a1

Please sign in to comment.