Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow https route declaration with 'https' array key and value #1655

Merged
merged 2 commits into from
Jun 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function __construct(Adapter $adapter, Container $container, Request $req
*/
protected function setupRouteProperties(Request $request, $route)
{
list($this->uri, $this->methods, $this->action) = $this->adapter->getRouteProperties($route, $request);
[$this->uri, $this->methods, $this->action] = $this->adapter->getRouteProperties($route, $request);

$this->versions = Arr::pull($this->action, 'version');
$this->conditionalRequest = Arr::pull($this->action, 'conditionalRequest', true);
Expand Down Expand Up @@ -278,7 +278,7 @@ public function getControllerInstance()
*/
protected function makeControllerInstance()
{
list($this->controllerClass, $this->controllerMethod) = explode('@', $this->action['uses']);
[$this->controllerClass, $this->controllerMethod] = explode('@', $this->action['uses']);

$this->container->instance($this->controllerClass,
$this->controller = $this->container->make($this->controllerClass));
Expand Down Expand Up @@ -511,7 +511,8 @@ public function methods()
*/
public function httpOnly()
{
return in_array('http', $this->action, true);
return in_array('https', $this->action, true)
|| (array_key_exists('https', $this->action) && $this->action['https']);
}

/**
Expand Down