Skip to content

Commit

Permalink
[TASK] Remove IE workaround in AbstractUserAuthentication
Browse files Browse the repository at this point in the history
The workaround in AbstractUserAuthentication targets versions
of Internet Explorer 6, which are not supported by TYPO3 nor by
Microsoft any more.

Resolves: #91992
Releases: master
Change-Id: I93007efbbaf044922e8d916a7552b9e1bea4ee96
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65312
Reviewed-by: Jörg Bösche <typo3@joergboesche.de>
Reviewed-by: Torben Hansen <derhansen@gmail.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Benni Mack <benni@typo3.org>
  • Loading branch information
derhansen authored and bmack committed Sep 11, 2020
1 parent b180b54 commit 30a87cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 30 deletions.
Expand Up @@ -415,25 +415,12 @@ protected function sendHttpHeaders()
*/
protected function getHttpHeaders(): array
{
$headers = [
return [
'Expires' => 0,
'Last-Modified' => gmdate('D, d M Y H:i:s') . ' GMT'
'Last-Modified' => gmdate('D, d M Y H:i:s') . ' GMT',
'Cache-Control' => 'no-cache, must-revalidate',
'Pragma' => 'no-cache'
];
$cacheControlHeader = 'no-cache, must-revalidate';
$pragmaHeader = 'no-cache';
// Prevent error message in IE when using a https connection
// see https://forge.typo3.org/issues/24125
if (strpos(GeneralUtility::getIndpEnv('HTTP_USER_AGENT'), 'MSIE') !== false
&& GeneralUtility::getIndpEnv('TYPO3_SSL')) {
// Some IEs can not handle no-cache
// see http://support.microsoft.com/kb/323308/en-us
$cacheControlHeader = 'must-revalidate';
// IE needs "Pragma: private" if SSL connection
$pragmaHeader = 'private';
}
$headers['Cache-Control'] = $cacheControlHeader;
$headers['Pragma'] = $pragmaHeader;
return $headers;
}

/**
Expand Down
Expand Up @@ -76,7 +76,7 @@ public function getAuthInfoArrayReturnsEmptyPidListIfNoCheckPidValueIsGiven()
/**
* @test
*/
public function getHttpHeadersReturnsNormalNoCacheHeadersForNonIe()
public function getHttpHeadersReturnsNoCacheHeaders()
{
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows NT 6.2; rv:22.0) Gecko/20130405 Firefox/23.0';
$_SERVER['HTTPS'] = 'on';
Expand All @@ -85,16 +85,4 @@ public function getHttpHeadersReturnsNormalNoCacheHeadersForNonIe()
$result = $subject->_call('getHttpHeaders');
self::assertEquals($result['Pragma'], 'no-cache');
}

/**
* @test
*/
public function getHttpHeadersReturnsSpecialNoCacheHeadersForIe()
{
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US)';
$_SERVER['HTTPS'] = 'on';
$subject = $this->getAccessibleMockForAbstractClass(AbstractUserAuthentication::class, [], '', false);
$result = $subject->_call('getHttpHeaders');
self::assertEquals($result['Pragma'], 'private');
}
}

0 comments on commit 30a87cd

Please sign in to comment.