File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,44 @@ public function testGetObject() {
283
283
}
284
284
}
285
285
286
+ /*
287
+ * get object,key访问getObject
288
+ * 404
289
+ */
290
+ public function testGetObjectInvalidKey ()
291
+ {
292
+ try {
293
+ $ key = "////// " ;
294
+ $ this ->cosClient ->getObject (array (
295
+ 'Bucket ' => $ this ->bucket ,
296
+ 'Key ' => $ key ,));
297
+ $ this ->assertTrue (False );
298
+ } catch (ServiceResponseException $ e ) {
299
+
300
+ $ this ->assertEquals (
301
+ 404 ,
302
+ $ e ->getExceptionCode ()
303
+ );
304
+ }
305
+ }
306
+
307
+ public function testGetObjectInvalidOtherKey ()
308
+ {
309
+ try {
310
+ $ key = "/../ " ;
311
+ $ this ->cosClient ->getObject (array (
312
+ 'Bucket ' => $ this ->bucket ,
313
+ 'Key ' => $ key ,));
314
+ $ this ->assertTrue (False );
315
+ } catch (ServiceResponseException $ e ) {
316
+
317
+ $ this ->assertEquals (
318
+ 404 ,
319
+ $ e ->getExceptionCode ()
320
+ );
321
+ }
322
+ }
323
+
286
324
/*
287
325
* range下载大文件
288
326
* 200
You can’t perform that action at this time.
0 commit comments