Accept-CH 標頭
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
HTTP Accept-CH 回應標頭可以由伺服器設定,以指定用戶在後續請求中應包含哪些用戶端提示標頭。為了確保用戶端提示能夠可靠地傳送,應該對所有安全請求持久化 Accept-CH 標頭。
| 標頭類型 | 回應標頭 |
|---|---|
| 禁止的請求標頭 | 否 |
| CORS 安全清單回應標頭 | 否 |
語法
http
Accept-CH: <client-hints-headers>
// 用戶端提示標頭,以逗號分隔的列表
Accept-CH: <ch-header-one>, <ch-header-two>
範例
>用戶端提示回應標頭
以下回應標頭表示伺服器在後續請求中接受 Viewport-Width 和 Width 裝置用戶端提示。Vary 標頭表示根據接受的用戶端提示來變更回應的值。
http
Accept-CH: Viewport-Width, Width
Vary: Viewport-Width, Width
規範
| Specification |
|---|
| HTTP Client Hints> # section-3.1> |
瀏覽器相容性
Loading…