File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -241,11 +241,6 @@ var apiWrapper = function (apiName, apiFn) {
241241 callback ( { error : 'lack of required params' } ) ;
242242 return ;
243243 }
244- // 优化 Key 参数
245- if ( params . Key && params . Key . indexOf ( '/' ) === 0 ) {
246- callback ( { error : 'params Key can not start width "/"' } ) ;
247- return ;
248- }
249244 // 判断 region 格式
250245 if ( params . Region && regionMap [ params . Region ] ) {
251246 callback ( { error : 'Region error, it should be ' + regionMap [ params . Region ] } ) ;
@@ -260,6 +255,10 @@ var apiWrapper = function (apiName, apiFn) {
260255 params . AppId = appId ;
261256 params . Bucket = bucket ;
262257 }
258+ // 兼容带有斜杠开头的 Key
259+ if ( params . Key && params . Key . substr ( 0 , 1 ) === '/' ) {
260+ params . Key = params . Key . substr ( 1 ) ;
261+ }
263262 }
264263 var res = apiFn . call ( this , params , callback ) ;
265264 if ( apiName === 'getAuth' ) {
You can’t perform that action at this time.
0 commit comments