[仅限PaaS]{class="badge informative" title="仅适用于云项目(Adobe管理的PaaS基础架构)和内部部署项目上的Adobe Commerce 。"}

ACSD-61845:使用​ text/html ​接受标头的请求出错

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
NOTE
该修补程序可能适用于具有新Quality Patches Tool发行版本的其他版本。 要检查修补程序是否与您的Adobe Commerce版本兼容,请将magento/quality-patches包更新到最新版本,并在Quality Patches Tool:搜索修补程序页面上检查兼容性。 使用修补程序ID作为搜索关键字来查找修补程序。

问题

发送在接受标头中仅具有​ text/html ​的HTTP请求时,由于媒体类型配置不匹配,出现500错误。

先决条件

B2B模块已安装和启用。

重现步骤

  1. 按如下所示发送请求,接受标头中只包含​ text/html

    code language-none
    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

应用修补程序

要应用单独的修补程序,请根据您的部署方法使用以下链接:

相关阅读

要了解有关Quality Patches Tool的更多信息,请参阅:

Quality Patches Tool: “工具”指南中用于高质量修补程序的的自助服务工具。

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3