Skip to content

Commit 9a00a04

Browse files
committed
fixed json with charset
1 parent 9acc34f commit 9a00a04

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

.travis.yml

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ php:
88
- 5.5
99
- 5.6
1010
before_script:
11-
- export QINIU_ACCESS_KEY="QWYn5TFQsLLU1pL5MFEmX3s5DmHdUThav9WyOWOm"
12-
- export QINIU_SECRET_KEY="Bxckh6FA-Fbs9Yt3i3cbKVK22UPBmAOHJcL95pGz"
13-
- export QINIU_TEST_BUCKET="phpsdk"
14-
- export QINIU_TEST_KEY="php-logo.png"
1511
- export QINIU_TEST_ENV="travis"
1612
- composer install --prefer-source
1713
script:

src/Qiniu/Http/Response.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public function needRetry()
169169

170170
private static function isJson($headers)
171171
{
172-
return isset($headers['Content-Type']) && $headers['Content-Type'] == 'application/json';
172+
return isset($headers['Content-Type']) &&
173+
strpos($headers['Content-Type'], 'application/json') === 0;
173174
}
174175
}

tests/bootstrap.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
use Qiniu\Auth;
66

7-
$accessKey = getenv('QINIU_ACCESS_KEY');
8-
$secretKey = getenv('QINIU_SECRET_KEY');
7+
$accessKey = 'QWYn5TFQsLLU1pL5MFEmX3s5DmHdUThav9WyOWOm';
8+
$secretKey = 'Bxckh6FA-Fbs9Yt3i3cbKVK22UPBmAOHJcL95pGz';
99
$testAuth = new Auth($accessKey, $secretKey);
10-
$bucketName = getenv('QINIU_TEST_BUCKET');
11-
$key = getenv('QINIU_TEST_KEY');
10+
$bucketName = 'phpsdk';
11+
$key = 'php-logo.png';
1212

1313
$dummyAccessKey = 'abcdefghklmnopq';
1414
$dummySecretKey = '1234567890';

0 commit comments

Comments
 (0)