dingo / api

A RESTful API package for the Laravel and Lumen frameworks.
BSD 3-Clause "New" or "Revised" License
9.33k stars 1.25k forks source link

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

Closed gazben closed 5 years ago

gazben commented 5 years ago

Allow https route declaration with 'https' array key and value.

$router->group(['https' => true], function (Router $router) {
});
gazben commented 5 years ago

@specialtactics Can you merge this? Or do you think it will break stuff?

specialtactics commented 5 years ago

Can't imagine any issues, but I guess we will have to see! I ran tests on a couple of projects I have and no issues, so merging.

Derjuju commented 4 years ago

Is this not a breaking change that prevent upgrading to Laravel/Lumen 6.x ?

1689

Illuminate\Routing\Route return true/false on httpOnly if 'http' is in action array Dingo\Api\Routing\Route return true/false on httpOnly if 'https' is in action array

Dingo\Api\Routing\Route extends Illuminate\Routing\Route

httpOnly, httpsOnly and secure methods shouldn't be overrided. They should keep the parent class logic.

Returning true with httpOnly when 'https' is set, is a non-sense... I think.

Maybe the code change was indeed for httpsOnly method and not for httpOnly method...

gazben commented 4 years ago

@Derjuju Oh my god, I messed this up. You are right. It should go to the httpsOnly/secure() function. I'll create the pull request