From 67852ba9cdd7f48e0e080961abebafee134fb329 Mon Sep 17 00:00:00 2001 From: jemygraw Date: Tue, 20 Feb 2018 21:59:54 +0800 Subject: [PATCH] fix uc domain problem fix http header case sensitive problem --- CHANGELOG.md | 9 ++++++++- src/Qiniu/Config.php | 4 ++-- src/Qiniu/Http/Response.php | 2 +- src/Qiniu/Zone.php | 9 +++++---- tests/Qiniu/Tests/ZoneTest.php | 1 - 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 943db006..8547bd88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ # Changelog -## 7.2.2 (2017-11-06 +## 7.2.3 (2018-01-20) +### 增加 +* 新加坡机房 +### 修正 +* 获取域名的入口域名 +* http回复头部兼容大小写 + +## 7.2.2 (2017-11-06) ### 增加 * Qiniu算法的鉴权方法 diff --git a/src/Qiniu/Config.php b/src/Qiniu/Config.php index d5ffeeef..296caa9c 100644 --- a/src/Qiniu/Config.php +++ b/src/Qiniu/Config.php @@ -3,14 +3,14 @@ final class Config { - const SDK_VER = '7.2.2'; + const SDK_VER = '7.2.3'; const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改 const RSF_HOST = 'rsf.qiniu.com'; const API_HOST = 'api.qiniu.com'; const RS_HOST = 'rs.qiniu.com'; //RS Host - const UC_HOST = 'https://uc.qbox.me'; //UC Host + const UC_HOST = 'https://api.qiniu.com'; //UC Host // Zone 空间对应的机房 public $zone; diff --git a/src/Qiniu/Http/Response.php b/src/Qiniu/Http/Response.php index 6f24780c..f22ab371 100644 --- a/src/Qiniu/Http/Response.php +++ b/src/Qiniu/Http/Response.php @@ -170,7 +170,7 @@ public function needRetry() private static function isJson($headers) { - return array_key_exists('content-type', $headers) && + return array_key_exists('Content-Type', $headers) && strpos($headers['Content-Type'], 'application/json') === 0; } } diff --git a/src/Qiniu/Zone.php b/src/Qiniu/Zone.php index 38e74d8e..1a66d39b 100644 --- a/src/Qiniu/Zone.php +++ b/src/Qiniu/Zone.php @@ -42,8 +42,8 @@ public function __construct( public static function zone0() { $Zone_z0 = new Zone( - array("up.qiniup.com", 'up-nb.qiniup.com', 'up-xs.qiniup.com'), - array('upload.qiniup.com', 'upload-nb.qiniup.com', 'upload-xs.qiniup.com'), + array("up.qiniup.com", 'up-jjh.qiniup.com', 'up-xs.qiniup.com'), + array('upload.qiniup.com', 'upload-jjh.qiniup.com', 'upload-xs.qiniup.com'), 'rs.qiniu.com', 'rsf.qiniu.com', 'api.qiniu.com', @@ -71,8 +71,8 @@ public static function zone1() public static function zone2() { $Zone_z2 = new Zone( - array('up-z2.qiniup.com', 'up-gz.qiniup.com', 'up-fs.qiniup.com'), - array('upload-z2.qiniup.com', 'upload-gz.qiniup.com', 'upload-fs.qiniup.com'), + array('up-z2.qiniup.com', 'up-dg.qiniup.com', 'up-fs.qiniup.com'), + array('upload-z2.qiniup.com', 'upload-dg.qiniup.com', 'upload-fs.qiniup.com'), "rs-z2.qiniu.com", "rsf-z2.qiniu.com", "api-z2.qiniu.com", @@ -123,6 +123,7 @@ public static function queryZone($ak, $bucket) return array(null, new Error($url, $ret)); } $r = ($ret->body === null) ? array() : $ret->json(); + //print_r($ret); //parse zone; $iovipHost = $r['io']['src']['main'][0]; diff --git a/tests/Qiniu/Tests/ZoneTest.php b/tests/Qiniu/Tests/ZoneTest.php index cf9226c3..d32875bd 100644 --- a/tests/Qiniu/Tests/ZoneTest.php +++ b/tests/Qiniu/Tests/ZoneTest.php @@ -36,7 +36,6 @@ protected function setUp() public function testUpHosts() { $zone = Zone::queryZone($this->ak, $this->bucketName); - print_r($zone); $this->assertContains('upload.qiniup.com', $zone->cdnUpHosts); $zone = Zone::queryZone($this->ak, $this->bucketNameBC);