Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qiniu

Package Overview
Dependencies
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qiniu - npm Package Compare versions

Comparing version 6.1.1 to 6.1.3

14

CHANGELOG.md
## CHANGE LOG
### v6.1.3
2014-4-03 issue [#102](https://github.com/qiniu/nodejs-sdk/pull/102)
- [#98] 增加pfop 功能
- [#99] 增加针对七牛callback的检查
### v6.1.2
2014-2-17 issue [#96](https://github.com/qiniu/nodejs-sdk/pull/96)
- Content-Length = 0 时的细节修复
### v6.1.1

@@ -4,0 +18,0 @@

2

index.js

@@ -10,2 +10,4 @@

conf: require(libpath + '/conf.js'),
rpc: require(libpath + '/rpc.js'),
util: require(libpath + '/util.js')
};

2

package.json
{
"name": "qiniu",
"version": "6.1.1",
"version": "6.1.3",
"description": "Node wrapper for Qiniu Resource (Cloud) Storage API",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,3 +5,3 @@

exports.USER_AGENT = 'qiniu nodejs-sdk v6.0.0';
exports.USER_AGENT = 'qiniu nodejs-sdk v6.1.3';

@@ -11,2 +11,2 @@ exports.UP_HOST = 'http://up.qbox.me';

exports.RSF_HOST = 'http://rsf.qbox.me';
exports.RPC_TIMEOUT = 3600000; // default rpc timeout: one hour
exports.RPC_TIMEOUT = 3600000; // default rpc timeout: one hour

@@ -0,2 +1,5 @@

var util = require('./util');
var rpc = require('./rpc');
var querystring = require('querystring');

@@ -6,2 +9,3 @@ exports.ImageView = ImageView;

exports.Exif = Exif;
exports.pfop = pfop;

@@ -53,1 +57,25 @@ function ImageView(mode, width, height, quality, format) {

function pfop(bucket, key, fops, opts, onret) {
opts = opts || {};
param = {
bucket: bucket,
key: key,
fops: fops
};
if (opts.notifyURL) {
param.notifyURL = opts.notifyURL;
} else {
param.notifyURL = 'www.test.com';
}
if (opts.force) {
param.force = 1;
}
var uri = 'http://api.qiniu.com/pfop/';
var body = querystring.stringify(param);
var auth = util.generateAccessToken(uri, body);
rpc.postWithForm(uri, body, auth, onret);
}

@@ -37,25 +37,25 @@ var urllib = require('urllib');

var content = null;
if (Buffer.isBuffer(form) || typeof form === 'string') {
content = form;
form = null;
}
var req = urllib.request(uri, {
var data = {
headers: headers,
method: 'POST',
content: content,
dataType: 'json',
timeout: conf.RPC_TIMEOUT,
}, function (err, result, res) {
if (err) {
err.code = res && res.statusCode || -1;
};
if (Buffer.isBuffer(form) || typeof form === 'string') {
data.content = form;
} else if (form) {
data.stream = form;
} else {
data.headers['Content-Length'] = 0;
};
var req = urllib.request(uri, data, function(err, result, res) {
var rerr = null;
if (err || Math.floor(res.statusCode/100) !== 2) {
rerr = {code: res&&res.statusCode||-1, error: err||result.error||''};
}
onresp(err, result, res);
onresp(rerr, result, res);
});
if (form) {
form.pipe(req);
}
}

@@ -186,2 +186,8 @@

}
if (this.persistentOps != null) {
flags['persistentOps'] = this.persistentOps;
}
if (this.persistentNotifyUrl != null) {
flags['persistentNotifyUrl'] = this.persistentNotifyUrl;
}
flags['deadline'] = this.expires + Math.floor(Date.now() / 1000);

@@ -188,0 +194,0 @@ return flags;

@@ -7,2 +7,4 @@ var fs = require('fs');

exports.isQiniuCallback = isQiniuCallback;
// ------------------------------------------------------------------------------------------

@@ -45,1 +47,7 @@ // func encode

}
function isQiniuCallback(path, body, callbackAuth) {
var auth = exports.generateAccessToken(path, body)
return auth === callbackAuth;
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc