getgrav/grav

Uri should prefer port in HTTP_HOST and not take SERVER_PORT

Open

#1,999 创建于 2018年4月27日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)PHP (1,409 fork)batch import
enhancementhelp wanted

仓库指标

Star
 (15,491 star)
PR 合并指标
 (平均合并 4天 13小时) (30 天内合并 8 个 PR)

描述

I run Grav in a docker container and use a different port internally. Uris get messed up for me because I map the internal docker port to a different port on the host.

Grav removes (correct) port from HTTP_HOST: https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Uri.php#L1138

And takes the (wrong) port from SERVER_PORT. https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Uri.php#L1144

Grav should take the port as the request was made, which is the port from HTTP_HOST.

贡献者指南