From 653843dc0226325ca4d8d592b8434426af51794c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sat, 19 Apr 2025 16:48:41 +0800 Subject: [PATCH] =?UTF-8?q?http=20=E7=8A=B6=E6=80=81=E7=A0=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0499?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- http_code.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/http_code.go b/http_code.go index 246d3cf..1199ea3 100644 --- a/http_code.go +++ b/http_code.go @@ -21,7 +21,11 @@ type HttpCode struct { func newHttpCodeData(httpCode int) HttpCode { desc := http.StatusText(httpCode) if len(desc) == 0 { - desc = fmt.Sprintf("%v: unknown error", httpCode) + if httpCode == 499 { + desc = "client request timeout" + } else { + desc = fmt.Sprintf("%v: unknown error", httpCode) + } } return HttpCode{ Value: httpCode, @@ -90,6 +94,7 @@ var ( newHttpCodeData(http.StatusTooManyRequests), newHttpCodeData(http.StatusRequestHeaderFieldsTooLarge), newHttpCodeData(http.StatusUnavailableForLegalReasons), + newHttpCodeData(499), // 5xx newHttpCodeData(http.StatusInternalServerError),