fix: Ignore non-HTML responses in storePreviousURL

This commit is contained in:
Tomohiro Murota 2022-05-21 18:46:13 +09:00
parent f012cc7f18
commit fd19d90a83
No known key found for this signature in database
GPG Key ID: C35C713D41EC66D7

View File

@ -1031,6 +1031,11 @@ class CodeIgniter
return;
}
// Ignore non-HTML responses
if (strpos($this->response->getHeaderLine('Content-Type'), 'text/html') === false) {
return;
}
// This is mainly needed during testing...
if (is_string($uri)) {
$uri = new URI($uri);