0

我有一个 TYPO3 9.5.0LTS 并使用引导程序包主题。似乎一切正常……我定义了站点配置,然后我得到了漂亮的 url……但我经常收到这样的错误消息:

核心:异常处理程序(WEB):未捕获的TYPO3异常:#1436717266:标头“Expire”的标头值无效。该值必须是字符串或字符串数​​组。|文件/is/www/typo3_src-9.5中引发的InvalidArgumentException .0/typo3/sysext/core/Classes/Http/Message.php 在第 208 行。请求的 URL:domain/content-examples/media/audio

是什么原因导致这种情况以及如何防止这种情况发生?

编辑:可能是第 4244 行 TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getHttpHeadersForTemporaryContent() 中的这一部分:

/**
 * Returns HTTP headers for temporary content.
 * These headers prevent search engines from caching temporary content and asks them to revisit this page again.
 * Please ensure to also send a 503 HTTP Status code with these headers.
 */
protected function getHttpHeadersForTemporaryContent(): array
{
    return [
        'Retry-after' => '3600',
        'Pragma' => 'no-cache',
        'Cache-control' => 'no-cache',
        'Expire' => 0,
    ];
}

...所以我将其更改为 'Expires' => 0

4

2 回答 2

1

https://forge.typo3.org/issues/86651#change-388813

“过期”标题中似乎有错字,应该是“过期”。尝试将其更改为:TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getHttpHeadersForTemporaryContent() 而他们正在解决这个问题

UPD

TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController,第 4244 行

'过期' => 0,

改成

'过期' => '0',

https://forge.typo3.org/issues/86658

正确的标题名称应该是'Expires' afaik: https ://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires

于 2018-10-16T06:11:59.573 回答
0

我想改变文件:

Typo3_src-9.5.0/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

在第 4244 行从

'过期' => 0,

'过期' => '0',

有帮助。该问题已报告https://forge.typo3.org/issues/86658并且将在下一次更新中更改,我敢肯定。

于 2018-10-30T09:08:12.307 回答