-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Redirects not working #931
Comments
Return value of CodeIgniter\HTTP\Message::getProtocolVersion() must be of the type string, null returned
In Common.php:768: function redirect(string $uri=null)
{
$response = Services::redirectResponse(null, true);
var_dump($response);exit;
if (! empty($uri))
{
return $response->to($uri);
}
return $response;
}
|
A temporary solution was to add the following in the Response constructor: $request = \Config\Services::request();
$this->setProtocolVersion($request->getProtocolVersion()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to use
redirect()->back();
after an POST request the HTTP Header are show on the page body, like:The motive is that the HTTP Version is not set.
Looking on
system/HTTP/Response.php
, line 597, thesendHeaders()
is called. And adding$this->setProtocolVersion('1.1');
just before could solve this issue.But I'm not sure if is the correct place to set it.
The text was updated successfully, but these errors were encountered: