codeigniter4 / codeigniter4/CodeIgniter4

Bug: Inconsistent hostname/subdomain limitation in Routing

未关闭
#7,214 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
PHP
星标
6k
派生
2k
平均合并
1 天 11 小时
30 天内合并 PR
73

描述

CodeIgniter version: 4.3.1

(1) `hostname` takes precedence over `subdomain`
if a route has both:
```php
$routes->get('/', 'Home::index');
$routes->get('/', 'Media::index', ['hostname' => 'media.example.com:8888', 'subdomain' => '*']);
```
`http://media.example.com:8888/ci431/public/` → `App\Controllers\Media::index`
`http://user.example.com:8888/ci431/public/` → `App\Controllers\Home::index`

(2) `subdomain` takes precedence over `hostname`
if two routes matches:
```php
$routes->get('/', 'Home::index');
$routes->get('/', 'Media::index', ['hostname' => 'media.example.com:8888']);
$routes->get('/', 'All::index', ['subdomain' => '*']);
```
`http://media.example.com:8888/ci431/public/` → `App\Controllers\All::index`
`http://user.example.com:8888/ci431/public/` → `App\Controllers\All::index`

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。