Skip to content

Commit 019bd5e

Browse files
committed
Merge pull request #110 from longbai/update-policy
update policy
2 parents 1ce0312 + d3e3484 commit 019bd5e

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: node_js
22
node_js:
33
- 0.10
4-
- 0.8
5-
- 0.6
64
before_script:
75
- export QINIU_ACCESS_KEY=QWYn5TFQsLLU1pL5MFEmX3s5DmHdUThav9WyOWOm
86
- export QINIU_SECRET_KEY=Bxckh6FA-Fbs9Yt3i3cbKVK22UPBmAOHJcL95pGz

qiniu/rs.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,16 @@ function getEncodedEntryUri(bucket, key) {
136136
// ----- token --------
137137
// @gist PutPolicy
138138
function PutPolicy(scope, callbackUrl, callbackBody, returnUrl, returnBody,
139-
asyncOps, endUser, expires) {
139+
asyncOps, endUser, expires, persistentOps, persistentNotifyUrl) {
140140
this.scope = scope || null;
141141
this.callbackUrl = callbackUrl || null;
142142
this.callbackBody = callbackBody || null;
143143
this.returnUrl = returnUrl || null;
144144
this.returnBody = returnBody || null;
145-
this.asyncOps = asyncOps || null;
146145
this.endUser = endUser || null;
147146
this.expires = expires || 3600;
147+
this.persistentOps = persistentOps || null;
148+
this.persistentNotifyUrl = persistentNotifyUrl || null;
148149
}
149150
// @endgist
150151

@@ -177,9 +178,6 @@ PutPolicy.prototype.getFlags = function(putPolicy) {
177178
if (this.returnBody != null) {
178179
flags['returnBody'] = this.returnBody;
179180
}
180-
if (this.asyncOps != null) {
181-
flags['asyncOps'] = this.asyncOps;
182-
}
183181
if (this.endUser != null) {
184182
flags['endUser'] = this.endUser;
185183
}
@@ -189,11 +187,25 @@ PutPolicy.prototype.getFlags = function(putPolicy) {
189187
if (this.persistentNotifyUrl != null) {
190188
flags['persistentNotifyUrl'] = this.persistentNotifyUrl;
191189
}
190+
if (this.persistentPipeline != null) {
191+
flags['persistentPipeline'] = this.persistentPipeline;
192+
}
193+
if (this.mimeLimit != null) {
194+
flags['mimeLimit'] = this.mimeLimit;
195+
}
196+
if (this.insertOnly != null) {
197+
flags['insertOnly'] = this.insertOnly;
198+
}
199+
if (this.detectMime != null) {
200+
flags['detectMime'] = this.detectMime;
201+
}
202+
if (this.saveKey != null) {
203+
flags['saveKey'] = this.saveKey;
204+
}
192205
flags['deadline'] = this.expires + Math.floor(Date.now() / 1000);
193206
return flags;
194207
}
195208

196-
197209
function GetPolicy(expires) {
198210
this.expires = expires || 3600;
199211
}

0 commit comments

Comments
 (0)