307 Star 1.5K Fork 331

GVPThinkPHP / thinkphp

 / 详情

为什么要将header参数统一成-连接

待办的
创建于  
2020-04-26 17:17
public function header(string $name = '', string $default = null)
    {
        if ('' === $name) {
            return $this->header;
        }

        $name = str_replace('_', '-', strtolower($name));      ////// here

        return $this->header[$name] ?? $default;
    }

评论 (2)

贝克汉狼 创建了任务
贝克汉狼 关联仓库设置为ThinkPHP/thinkphp
展开全部操作日志

在 nginx 服务器中 underscores_in_headers 该选项默认为关闭
所以在默认情况下,所有包含下划线的字段名都会被丢弃
建议不要在 header 中的参数使用下划线,参数名可采用驼峰方法

好久远了,那时候我还是菜鸡。还是谢谢你啦

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
1260060 shiwujintou 1578947604 1123407 eddy87 1686927469
PHP
1
https://gitee.com/liu21st/thinkphp.git
git@gitee.com:liu21st/thinkphp.git
liu21st
thinkphp
thinkphp

搜索帮助

14c37bed 8189591 565d56ea 8189591