我有一个TYPO3 9.5.0LTS并使用bootstrap包主题 . 它似乎全部工作......我定义了网站配置然后我得到了漂亮的网址...但我经常得到这样的错误消息:
核心:异常处理程序(WEB):未捕获TYPO3异常:#1436717266:标头“Expire”的标头值无效“ . 值必须是字符串或字符串数组 . |文件/is/www/typo3_src-9.5中抛出InvalidArgumentException第208行中的.0 / typo3 / sysext / core / Classes / Http / Message.php . 请求的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
2 回答
https://forge.typo3.org/issues/86651#change-388813
看来“Expire” Headers 中有一个拼写错误,应该是“Expires” . 尝试将其更改为:TYPO3 \ CMS \ Frontend \ Controller \ TypoScriptFrontendController :: getHttpHeadersForTemporaryContent(),同时修复此问题
UPD
TYPO3 \ CMS \ Frontend \ Controller \ TypoScriptFrontendController,第4244行
改成
https://forge.typo3.org/issues/86658
正确的 Headers 名称应为'Expires' afaik:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires
我想改变文件:
typo3_src-9.5.0 / TYPO3 / sysext /前端/类别/控制器/ TypoScriptFrontendController.php
在4244线上
'Expire'=> 0,
至
'Expire'=>'0',
帮助 . 该问题已报告https://forge.typo3.org/issues/86658,我将在下次更新时进行更改 .