Skip to content

Commit 1ce0312

Browse files
committed
Merge pull request #109 from longbai/new_ua
new useragent
2 parents da44a56 + 691718e commit 1ce0312

File tree

9 files changed

+33
-21
lines changed

9 files changed

+33
-21
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ node_js:
44
- 0.8
55
- 0.6
66
before_script:
7-
- export QINIU_ACCESS_KEY="nnwjTeUgpQdfZp9cb4-iHK0EUlebKCNk4kXwoStq"
8-
- export QINIU_SECRET_KEY="Ia9pXC-XEcGF6hvu1V5fdRhwFLpeUkCbt0Gxk5NW"
9-
- export QINIU_TEST_BUCKET="test741"
10-
- export QINIU_TEST_DOMAIN="test741.qiniudn.com"
7+
- export QINIU_ACCESS_KEY=QWYn5TFQsLLU1pL5MFEmX3s5DmHdUThav9WyOWOm
8+
- export QINIU_SECRET_KEY=Bxckh6FA-Fbs9Yt3i3cbKVK22UPBmAOHJcL95pGz
9+
- export QINIU_TEST_BUCKET="nodesdk"
10+
- export QINIU_TEST_DOMAIN="nodesdk.qiniudn.com"

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
## CHANGE LOG
22

3+
### v6.1.5
4+
5+
2014-4-03 issue [#111](https://github.com/qiniu/nodejs-sdk/pull/111)
6+
7+
- [#109] 统一user agent
8+
- [#110] 更新put policy
9+
10+
### v6.1.4
11+
12+
2014-4-03 issue [#108](https://github.com/qiniu/nodejs-sdk/pull/108)
13+
14+
- [#107] 调整上传host
15+
16+
317
### v6.1.3
418

519
2014-4-03 issue [#102](https://github.com/qiniu/nodejs-sdk/pull/102)

gopher.png

5.46 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qiniu",
3-
"version": "6.1.3",
3+
"version": "6.1.5",
44
"description": "Node wrapper for Qiniu Resource (Cloud) Storage API",
55
"main": "index.js",
66
"directories": {

qiniu/conf.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
var fs = require('fs');
2+
var path = require('path');
3+
var os = require('os');
14

25
exports.ACCESS_KEY = '<PLEASE APPLY YOUR ACCESS KEY>';
36
exports.SECRET_KEY = '<DONT SEND YOUR SECRET KEY TO ANYONE>';
47

5-
exports.USER_AGENT = 'qiniu nodejs-sdk v6.1.3';
8+
var pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../', 'package.json')));
9+
var ua = function(){
10+
return 'QiniuNodejs/' + pkg.version + ' (' + os.type() + '; ' + os.platform() + '; ' + os.arch() + '; )';
11+
}
12+
13+
exports.USER_AGENT = ua();
614

715
exports.UP_HOST = 'http://upload.qiniu.com';
816
exports.RS_HOST = 'http://rs.qbox.me';

qiniu/util.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ exports.generateAccessToken = function(uri, body) {
4545
}
4646

4747
function isQiniuCallback(path, body, callbackAuth) {
48-
49-
var auth = exports.generateAccessToken(path, body)
48+
var auth = exports.generateAccessToken(path, body);
5049
return auth === callbackAuth;
5150
}

test/fop.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var fop = require('../').fop;
22

33
describe('test start step 0', function() {
44
describe('fop.js', function() {
5-
var pic = 'http://test963.qiniudn.com/logo.png';
5+
var pic = 'http://private-res.qiniudn.com/gogopher.jpg';
66

77
describe('fop.Exif#makeRequest()', function() {
88
it('test makeRequest', function(done) {

test/logo.png

4.36 KB
Loading

test/rs.test.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('test start step2:', function() {
8888
describe('rs.Client#batchStat()', function() {
8989
it('get the stat of logo.png and logo2.png', function(done) {
9090
var entries = [
91-
new EntryPath(TEST_BUCKET, logo),
91+
new EntryPath(TEST_BUCKET, logo),
9292
new EntryPath(TEST_BUCKET, logo2)];
9393

9494
client.batchStat(entries, function(err, ret) {
@@ -105,7 +105,7 @@ describe('test start step2:', function() {
105105
it('should return code 298 when partial ok', function(done) {
106106

107107
var entries = [
108-
new EntryPath(TEST_BUCKET, logo),
108+
new EntryPath(TEST_BUCKET, logo),
109109
new EntryPath(TEST_BUCKET, 'not exist file')];
110110

111111
client.batchStat(entries, function(err, ret) {
@@ -167,23 +167,14 @@ describe('test start step2:', function() {
167167
describe('rs.isQiniuCallBack', function() {
168168

169169
it('test isQiniuCallback true', function(done) {
170-
// @gist isQiniuCallback
171-
// ------ auth应该是来自请求的header的'Authrization'字段,path是请求的路径,content是请求的内容
172-
var auth = 'QBox nnwjTeUgpQdfZp9cb4-iHK0EUlebKCNk4kXwoStq:kyFuG6yYh6FlX1fZO0alTgJK2Jw=';
170+
var auth = 'QBox QWYn5TFQsLLU1pL5MFEmX3s5DmHdUThav9WyOWOm:4GcOC2_eiw97QBNsHiwLzSqxelI=';
173171
var path = '/callback';
174172
var content = 'key=43850.6579994258936495&hash=FllOJrhvzorEKnyMwE-o7pfciiha';
175-
// ------
176-
177173
var ok = qiniu.util.isQiniuCallback(path, content, auth);
178174
ok.should.be.ok;
179-
// @endgist
180175
done();
181176
});
182-
183-
184177
});
185178

186-
// rs.GetPolicy#makeRequest()
187-
188179
});
189180
});

0 commit comments

Comments
 (0)