Maximum on http header values?

前端 未结 5 773
-上瘾入骨i
-上瘾入骨i 2020-11-22 09:45

Is there an accepted maximum allowed size for HTTP headers? If so, what is it? If not, is this something that\'s server specific or is the accepted standard to allow heade

5条回答
  •  半阙折子戏
    2020-11-22 10:27

    I also found that in some cases the reason for 502/400 in case of many headers could be because of a large number of headers without regard to size. from the docs

    tune.http.maxhdr Sets the maximum number of headers in a request. When a request comes with a number of headers greater than this value (including the first line), it is rejected with a "400 Bad Request" status code. Similarly, too large responses are blocked with "502 Bad Gateway". The default value is 101, which is enough for all usages, considering that the widely deployed Apache server uses the same limit. It can be useful to push this limit further to temporarily allow a buggy application to work by the time it gets fixed. Keep in mind that each new header consumes 32bits of memory for each session, so don't push this limit too high.

    https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#3.2-tune.http.maxhdr

提交回复
热议问题