Warp 有一个settingsMaxTotalHeaderLength
默认为 50*1024的字段:https : //hackage.haskell.org/package/warp-3.3.10/docs/src/Network.Wai.Handler.Warp.Settings.html#defaultSettings
我想这意味着 50KB?但是,当我尝试发送一个 ~33KB 的标头时,服务器会抛出错误的请求:
curl -v -w '%{size_request} %{size_upload}' -H @temp.log localhost:8080/v1/version
Run Code Online (Sandbox Code Playgroud)
结果:
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /v1/version HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.58.0
> Accept: */*
> myheader2: <big header snipped>
>
* HTTP 1.0, assume close after body
< HTTP/1.0 400 Bad Request
< Date: Wed, 22 Jul 2020 13:15:19 GMT
< Server: Warp/3.3.10
< Content-Type: text/plain; …
Run Code Online (Sandbox Code Playgroud)