mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
Screenshot resizing works in the UI now. Still missing rate limiting.
This commit is contained in:
@@ -31,7 +31,7 @@ module.exports = syrup.serial()
|
||||
)))
|
||||
}
|
||||
else {
|
||||
resolve(storage.store(res, {
|
||||
resolve(storage.store('image', res, {
|
||||
filename: util.format('%s.png', options.serial)
|
||||
, contentType: 'image/png'
|
||||
, knownLength: +res.headers['content-length']
|
||||
|
||||
@@ -11,11 +11,11 @@ module.exports = syrup.serial()
|
||||
var log = logger.createLogger('device:support:storage')
|
||||
var plugin = Object.create(null)
|
||||
|
||||
plugin.store = function(stream, meta) {
|
||||
plugin.store = function(type, stream, meta) {
|
||||
var resolver = Promise.defer()
|
||||
|
||||
var req = request.post({
|
||||
url: util.format('%sapi/v1/resources', options.storageUrl)
|
||||
url: util.format('%sapi/v1/s/%s', options.storageUrl, type)
|
||||
}
|
||||
, function(err, res, body) {
|
||||
if (err) {
|
||||
@@ -32,7 +32,7 @@ module.exports = syrup.serial()
|
||||
else {
|
||||
try {
|
||||
var result = JSON.parse(body)
|
||||
log.info('Uploaded to %s', result.resources.file.url)
|
||||
log.info('Uploaded to %s', result.resources.file.href)
|
||||
resolver.resolve(result.resources.file)
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user