在我的程序中,我发送的其中一个请求在收到响应时会引发 Header Overflow 错误。我目前能够在命令行中使用 运行我的程序node --max-http-header-size=15000 app.js
,但现在我想使用 pkg 和 nexe 等 npm 包将程序编译为可执行文件。我也尝试过同时使用这两种方法,但没有发现任何方法可以合并--max-http-header-size=15000
到 pkg 中。使用 nexe,我能够使用以下代码创建编译器:
const { compile } = require('nexe')
compile({
input: './app.js',
flags: ['--max-http-header-size 20000'],
targets: 'windows-x64-12.16.3'
}).then(() => {
console.log('success')
})
但是,如果我要node app.js
在命令行中运行而不调整最大标头大小,这并不能有效地避免出现标头溢出错误。我也在nexe app.js -f --max-http-header-size=15000 -t windows-x64-12.16.3
终端中运行过,但没有成功避免溢出错误。如果有帮助,我将使用 Axios 作为我的请求库。任何帮助表示赞赏,谢谢!