Skip to content

Commit

Permalink
fix uc domain problem
Browse files Browse the repository at this point in the history
fix http header case sensitive problem
  • Loading branch information
jemygraw committed Feb 20, 2018
1 parent 28e51bd commit 67852ba
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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算法的鉴权方法

Expand Down
4 changes: 2 additions & 2 deletions src/Qiniu/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Qiniu/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
9 changes: 5 additions & 4 deletions src/Qiniu/Zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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];
Expand Down
1 change: 0 additions & 1 deletion tests/Qiniu/Tests/ZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 67852ba

Please sign in to comment.