4

I dd(redirect()->intended()) and the default response is HTTP...

Using the 4th parameter of the function intended() I switch to secure and still redirected to HTTP.

I even changed to default value of the function.

FROM:

public function intended($status = 302, $headers = [], $secure = null)
{
    $back = $this->generator->previous();    
    $path = $this->session->pull('url.intended', $back);    
    return $this->to($path, $status, $headers, $secure);
}

TO:

public function intended($status = 302, $headers = [], $secure = TRUE)
{
    $back = $this->generator->previous();

    $path = $this->session->pull('url.intended', $back);

    return $this->to($path, $status, $headers, $secure);
}

And every time I dd() the intended URL is HTTP. I tried by using the secure() function but it requires a $path parameter.

So then I created a custom secure_intended() which response is HTTP as well.

public function secure_intended($status = 302, $headers = [])
{
    $back = $this->generator->previous();    
    $path = $this->session->pull('url.intended', $back);  
    return $this->to($path, $status, $headers, true);
}

So is there another way around all this? Am I missing a function from Laravel I can use? Has someone encountered the same problem?

Simeon Stoyanov
  • 139
  • 2
  • 9
  • 1
    This post may help you to find a way to do this: https://stackoverflow.com/questions/46563398/laravel-5-force-https-issue-with-login-routing-to-http – Petrius Lima Jul 11 '18 at 16:11

0 Answers0