Skip to content

Response::isJson() 实现问题 #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
71sprite opened this issue Dec 28, 2021 · 2 comments · Fixed by #372
Closed

Response::isJson() 实现问题 #371

71sprite opened this issue Dec 28, 2021 · 2 comments · Fixed by #372

Comments

@71sprite
Copy link

https://github.com/qiniu/php-sdk/blob/master/src/Qiniu/Http/Response.php#L183

此处只要满足 array_key_exists('content-type', $headers) 即返回 true,看起来不太合理

@lihsai0
Copy link
Collaborator

lihsai0 commented Dec 28, 2021

的确不合理,已安排,修复后会关闭此 issue

感谢反馈

@anhao
Copy link

anhao commented Dec 31, 2021

{
    $headers = array_change_key_case($headers);
    return array_key_exists('content-type', $headers) && strpos($headers['content-type'], 'application/json') === 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants