@@ -143,7 +143,7 @@ var getTempKeys = function (callback) {
143
143
Action : Action ,
144
144
durationSeconds : 7200 ,
145
145
name : 'cos' ,
146
- policy : encodeURIComponent ( policyStr ) ,
146
+ policy : encodeURIComponent ( policyStr ) . replace ( / \* / g , '%2A' ) ,
147
147
} ;
148
148
params . Signature = util . getSignature ( params , config . SecretKey , Method ) ;
149
149
@@ -162,6 +162,7 @@ var getTempKeys = function (callback) {
162
162
if ( body && body . data ) body = body . data ;
163
163
tempKeysCache . credentials = body . credentials ;
164
164
tempKeysCache . expiredTime = body . expiredTime ;
165
+ tempKeysCache . policyStr = policyStr ;
165
166
callback ( err , body ) ;
166
167
} ) ;
167
168
} ;
@@ -197,7 +198,7 @@ app.all('/sts-auth', function (req, res, next) {
197
198
SecretKey : tempKeys . credentials . tmpSecretKey ,
198
199
Method : req . body . method || req . query . method ,
199
200
Key : Key ,
200
- Query : req . body . query || req . query . method || { } ,
201
+ Query : req . body . query || req . query . query || { } ,
201
202
Headers : req . body . headers || req . query . headers || { } ,
202
203
} ;
203
204
data = {
@@ -209,8 +210,7 @@ app.all('/sts-auth', function (req, res, next) {
209
210
} ) ;
210
211
} ) ;
211
212
app . all ( '*' , function ( req , res , next ) {
212
- res . writeHead ( 404 ) ;
213
- res . send ( '404 Not Found' ) ;
213
+ res . status ( 404 ) . send ( '404 Not Found' ) ;
214
214
} ) ;
215
215
216
216
// 启动签名服务
0 commit comments