Response的isJson不支持http2的返回头
Closed this issue · 3 comments
2.0的头是:
HTTP/2 200
server: openresty
date: Tue, 23 Jun 2020 01:36:08 GMT
content-type: application/json
content-length: 546
access-control-allow-origin: *
access-control-expose-headers: X-Log, X-Reqid
access-control-max-age: 2592000
x-log: redis.g;redis.g;BUCKET
x-reqid: dEcAAPyiZKBvCBsW
但是处理方法里面不支持小写
private static function isJson($headers)
{
return array_key_exists('Content-Type', $headers) &&
strpos($headers['Content-Type'], 'application/json') === 0;
}
Duplicate of #324
仅七牛内部员工可见:https://jira.qiniu.io/browse/TS-981
private static function isJson($headers)
{
return array_key_exists('content-type', $headers) || array_key_exists('Content-Type', $headers) &&
strpos($headers['Content-Type'], 'application/json') === 0;
}