ACSD-61845:使用 text/html 接受标头的请求出错
最近更新: 2024年12月2日
- 主题:
- B2B
创建对象:
- 有经验的
- 管理员
- 开发人员
ACSD-61845修补程序修复了仅具有 text/html 接受标头的HTTP请求因响应处理中的媒体类型不匹配而导致500错误的问题。 安装Quality Patches Tool (QPT) 1.1.54时,此修补程序可用。 修补程序ID为ACSD-61845。 请注意,该问题计划在Adobe Commerce 2.4.8中修复。
受影响的产品和版本
为Adobe Commerce版本创建了修补程序:
- Adobe Commerce(所有部署方法) 2.4.7-p1
与Adobe Commerce版本兼容:
- Adobe Commerce(所有部署方法) 2.4.7-p1 - 2.4.7-p3
该修补程序可能适用于具有新Quality Patches Tool发行版本的其他版本。 要检查修补程序是否与您的Adobe Commerce版本兼容,请将
magento/quality-patches
包更新到最新版本,并在Quality Patches Tool:搜索修补程序页面上检查兼容性。 使用修补程序ID作为搜索关键字来查找修补程序。问题
发送在接受标头中仅具有 text/html 的HTTP请求时,由于媒体类型配置不匹配,出现500错误。
先决条件:
B2B模块已安装和启用。
重现步骤:
-
按如下所示发送请求,接受标头中只包含 text/html:
curl -I --header "Accept: text/html, text/plain" http://<hostname>/pub/
预期的结果:
返回带有 200状态代码 的页面。
实际结果:
返回了500错误,exception.log
中带有以下错误消息:
Magento\Framework\Webapi\Exception: Server cannot match any of the given Accept HTTP header media type(s) from the request: "text/html" with media types from the config of response renderer. in vendor/magento/framework/Webapi/Rest/Response/RendererFactory.php:84
应用修补程序
要应用单独的修补程序,请根据您的部署方法使用以下链接:
- Adobe Commerce或Magento Open Source内部部署: Quality Patches Tool指南中的Quality Patches Tool >使用情况。
- 云基础架构上的Adobe Commerce:云基础架构上的Commerce指南中的升级和修补程序>应用修补程序。
recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3