walkor / webman-framework

webman-framework
118 stars 61 forks source link

\Webman\Http\Request::acceptJson 没有考虑请求没有 accept header 的情况 #31

Closed feng-yifan closed 2 years ago

feng-yifan commented 2 years ago
    /**
     * @return bool
     */
    public function acceptJson()
    {
        return false !== strpos($this->header('accept'), 'json');
    }

如上,若 $this->header('accept') 的值为 null 则产生异常

walkor commented 2 years ago

感谢反馈,主干已经修复。等下个版本一同发布