505 HTTP 版本不受支援
HTTP 的505 HTTP 版本不支援 伺服器錯誤響應 狀態碼錶示伺服器不支援請求中使用的 HTTP 版本。
當請求行格式不正確時,例如 GET /path to resource HTTP/1.1 或者使用 \n 而不是 \r\n 終止請求行,通常會看到此錯誤。例如,負載均衡器等中介軟體可能無法處理轉發請求的請求行,如下例所示。
狀態
http
505 HTTP Version Not Supported
規範
| 規範 |
|---|
| HTTP 語義 # status.505 |
示例
由於請求行格式錯誤導致的 505
在以下示例中,客戶端請求 example.com/dog%20trainers,但由於負載均衡器配置錯誤,URL 中的百分比編碼未正確處理。在這種情況下,源伺服器看到 trainers 而不是 HTTP 版本,並返回 505 響應。響應正文中包含請求識別符號,用於說明一種可能幫助伺服器管理員縮小問題根本原因範圍的方法。
http
GET /dog trainers HTTP/1.1
Host: example.com
http
HTTP/1.1 505 HTTP Version Not Supported
Content-Type: text/html;
Content-Length: 123
<!doctype html>
<html lang="en">
<head>
<title>505 HTTP Version Not Supported</title>
</head>
<body>
<h1>505 HTTP Version Not Supported</h1>
<p>If this problem persists, please <a href="https://example.com/support">contact support</a>.</p>
<p>Server logs contain details of this error with request ID: ABC-123.</p>
</body>
</html>