Skip to content

Commit 124a2a8

Browse files
committed
documents http code
1 parent fab5b48 commit 124a2a8

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

content/en/docs/hertz/faq/_index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ For very vast requests cases, use a combination of streaming and go net.
3535

3636
If the framework reports the following error codes, you can check it for possible causes. If there is an error code other than the following, the error code is not caused by the framework and needs to be located by the user to see whether it is set by itself or by some middleware.
3737

38+
### 403
39+
40+
This status code is returned only when the `fs` feature is enabled and a directory index is accessed without permission. Hertz does not return `403` in other scenarios.
41+
3842
### 404
3943

4044
1. Access to the wrong port, commonly access to the debug port.
@@ -43,10 +47,18 @@ If the framework reports the following error codes, you can check it for possibl
4347
1. Check whether all expected routes are registered correctly based on the startup log.
4448
2. Check that the access method is correct.
4549

50+
### 413
51+
52+
The request body sent by the client exceeds the maximum size configured by [`WithMaxRequestBodySize`](../reference/config.md) on the server side. The default limit is 4 MB.
53+
4654
### 417
4755

4856
The server returns `false` after executing the custom `ContinueHandler` (the server actively rejects the subsequent body of the 100 Continue).
4957

58+
### 431
59+
60+
The request header sent by the client exceeds the maximum size configured by [`WithMaxHeaderBytes`](../reference/config.md) on the server side. The default limit is 1 MB.
61+
5062
### 500
5163

5264
1. Throwing the panic in middleware or in `handlerFunc`.

content/zh/docs/hertz/faq/_index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ description: "Hertz 常见问题解答。"
2929

3030
如果框架报以下的错误码,可以按照可能原因进行排查。如果出现非以下错误码,则不是框架打出来的,需要由使用方定位一下是否自行设置或者由某些中间件设置了错误码。
3131

32+
### 403
33+
34+
仅在启用fs功能,访问无权限的目录索引时才会出现403错误码,其他场景下不会出现403错误码。
35+
3236
### 404
3337

3438
1. 访问到了错误的端口上了,常见访问到了 debug 端口
@@ -37,10 +41,18 @@ description: "Hertz 常见问题解答。"
3741
1. 根据启动日志查看是否所有预期路由都正常注册
3842
2. 查看访问方法是否正确
3943

44+
### 413
45+
46+
client 发送的请求体(request body)大小超出服务端配置 [`WithMaxRequestBodySize`](../reference/config.md) 的最大值(默认为 4MB)。
47+
4048
### 417
4149

4250
server 在执行完自定义的 `ContinueHandler` 之后返回 `false`(server 主动拒绝掉 100 Continue 后续的 body)。
4351

52+
### 431
53+
54+
client 发送的请求头(request header)大小超出服务端配置 [`WithMaxHeaderBytes`](../reference/config.md) 的最大值(默认为 1MB)。
55+
4456
### 500
4557

4658
1. 中间件或者 `handlerFunc` 中抛 panic

0 commit comments

Comments
 (0)