webman 请求URL如何设置不区分大小写

baker

问题描述

webman 请求URL如何设置不区分大小写
比如请求 http://127.0.0.1:8787/api/index/index
http://127.0.0.1:8787/Api/Index/index

也能请求,现在返回404

879 2 0
2个回答

six

默认路由不区分大小写,手动设置路由估计区分大小写

  • baker 2022-11-30

    在哪里设置?

  • 棋子 2023-04-03

    为什么webman的url是区分大小写的?
    //a: 因为webman的路由是由fast-route来实现的,fast-route的路由是区分大小写的。
    // 如果需要忽略大小写,可以在Route::any()中加上第四个参数true,表示忽略大小写。
    // Route::any('/index.html', [app\controller\IndexController::class, 'index'], 'index', true);
    // 如果需要全部忽略大小写,可以在config\route.php中加上第四个参数true,表示忽略大小写。
    // Route::any('/index.html', [app\controller\IndexController::class, 'index'], 'index', true);
    // Route::any('/Index.html', [app\controller\IndexController::class, 'index'], 'index', true);

powerbowen

用默认的自动路由不区分大小写,手动配置路由一直没用不过按照LV的尿性估计这个也区分大小写

  • 暂无评论
年代过于久远,无法发表回答
×
🔝