8000 Ability to set `_https` inside named configuration · Issue #18019 · cakephp/cakephp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Ability to set _https inside named configuration #18019
Closed
@mehov

Description

@mehov

I am defining a named route inside config/routes.php. I want to force that route to be HTTP, not HTTPs.

The _https flag, listed under Reserved Route Elements, is what I'm looking for. And because that section is under Connecting Routes (see Page Contents), that kind of implies I can use these Reserved Route Elements when connecting my routes.

What I did

// config/routes.php
$routes->connect(
    '/example',
    [
        'controller' => 'Articles',
        'action' => 'example',
    ],
    [
        '_name' => 'example',
        '_host' => 'example.com',
        // tried everything, including the legacy `_ssl`
        '_https' => false,
        '_ssl' => false,
        '_scheme' => 'http',
    ]
);
// elsewhere
echo Router::url(['_name' => 'example']);

What I expected to happen

http://example.com/articles/example

What happened

https://example.com/articles/example

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0