File tree Expand file tree Collapse file tree 5 files changed +20
-1
lines changed Expand file tree Collapse file tree 5 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 22
33## Next Version
44* 对象存储,修复无法对 key 为空字符串的对象进行操作
5+ * 修复 301 重定向无法正确获取 header 信息
56
67## 7.8.0 (2022-10-25)
78* 移除不推荐域名,并增加区域亚太-首尔和华东-浙江2
Original file line number Diff line number Diff line change @@ -35,8 +35,9 @@ public function __construct($obj = array())
3535 */
3636 public static function parseRawText ($ raw )
3737 {
38+ $ multipleHeaders = explode ("\r\n\r\n" , trim ($ raw ));
3839 $ headers = array ();
39- $ headerLines = explode ("\r\n" , $ raw );
40+ $ headerLines = explode ("\r\n" , end ( $ multipleHeaders ) );
4041 foreach ($ headerLines as $ line ) {
4142 $ headerLine = trim ($ line );
4243 $ kv = explode (': ' , $ headerLine );
Original file line number Diff line number Diff line change @@ -32,6 +32,15 @@ public function testGetTimeout()
3232 $ this ->assertEquals (-1 , $ response ->statusCode );
3333 }
3434
35+ public function testGetRedirect ()
36+ {
37+ $ response = Client::get ('localhost:9000/redirect.php ' );
38+ $ this ->assertEquals (200 , $ response ->statusCode );
39+ $ this ->assertEquals ('application/json;charset=UTF-8 ' , $ response ->normalizedHeaders ['Content-Type ' ]);
40+ $ respData = $ response ->json ();
41+ $ this ->assertEquals ('ok ' , $ respData ['msg ' ]);
42+ }
43+
3544 public function testDelete ()
3645 {
3746 $ response = Client::delete ('uc.qbox.me/bucketTagging ' , array ());
Original file line number Diff line number Diff line change 1+ <?php
2+ header ("Content-Type: application/json;charset=UTF-8 " );
3+ echo '{"msg": "ok"} ' ;
Original file line number Diff line number Diff line change 1+ <?php
2+ header ("Content-Type: text/plain;charset=UTF-8 " , true );
3+ header ("Location: ./ok.php " , true , 301 );
4+ echo "redirect to ok.php " ;
5+ exit ();
You can’t perform that action at this time.
0 commit comments