【问题标题】:How to change the request header limitation [duplicate]如何更改请求标头限制[重复]
【发布时间】:2016-11-23 07:36:32
【问题描述】:
我在我的 localhost:3000 上启动了 node express..
**curl -H 'samlresponse:12323' -v http://localhost:3000 ,正确返回数据。
但如果我尝试关注...
curl -H 'samlresponse:{这是整个 samlresponse,很长..差不多 20k..}' -v http://localhost:3000
服务器总是返回"Empty reply from server",有没有办法绕过或解决这个问题?
【问题讨论】:
标签:
node.js
express
header
request
【解决方案1】:
Source Code of node at github 说:
/* Maximium header size allowed. If the macro is not defined
* before including this header then the default is used. To
* change the maximum header size, define the macro in the build
* environment (e.g. -DHTTP_MAX_HEADER_SIZE=<value>). To remove
* the effective limit on the size of the header, define the macro
* to a very large number (e.g. -DHTTP_MAX_HEADER_SIZE=0x7fffffff)
*/
#ifndef HTTP_MAX_HEADER_SIZE
# define HTTP_MAX_HEADER_SIZE (80*1024)
#endif
因此,您可能需要从源代码重建节点以超过 80*1024 的限制。但是,我个人认为,对于一个标题来说,它已经足够大了,你应该重新评估你的策略是否正确。