ACSD-61845:含 text/html 接受標頭的請求發生錯誤
最後更新: 2024年12月3日
- 主題:
- 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作為搜尋關鍵字,以尋找修補程式。問題
傳送accept標頭中只有 text/html 的HTTP要求時,因為媒體型別設定不符,而發生500錯誤。
必要條件:
B2B模組已安裝且已啟用。
要再現的步驟:
-
傳送在accept標頭中只有 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
套用修補程式
若要套用個別修補程式,請根據您的部署方法使用下列連結:
- Quality Patches Tool指南中的Adobe Commerce或Magento Open Source內部部署: Quality Patches Tool >使用狀況。
- 雲端基礎結構上的Adobe Commerce:雲端基礎結構上的Commerce指南中的升級和修補程式>套用修補程式。
recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3