sessionstore-affecting headers-error[err\u http\u headers\u sent]:将头发送到客户端后无法设置头

xxslljrj  于 2021-06-21  发布在  Mysql
关注(0)|答案(0)|浏览(242)

我有以下代码并得到以下错误:
https://github.com/ericx2x/notes
此错误仅在我将“store:sessionstore”添加到此行“router.use(session({secret:'iloveel89',store:sessionstore,resave:true,saveuninitialized:true,logged:false,cookie:{maxage:7200000}])时显示
简单地添加一个会话存储不应该影响我的头。。不知道为什么我会看到这种行为。到目前为止,我试着 resave 设置为false/true,并尝试同时使用psql/mysql存储我的会话。似乎没有什么能消除这个错误。。
get/api/notes 304 11.571 ms--get/api/password/304 9.699 ms--error[err\u http\u headers\u sent]:在serverresponse.header的validateheader(\u http\u outgoing.js:500:11)处将头发送到serverresponse.setheader(\u http\u outgoing.js:507:3)处的客户端后,无法设置头(/home/el8le/workspace/notes/node\u modules/express/lib/response.js:767:10)在serverresponse.contenttype(/home/el8le/workspace/notes/node\u modules/express/lib/response.js:595:15)在serverresponse.send(/home/el8le/workspace/notes/node\u modules/express/lib/response.js:145:14)完成(/home/el8le/workspace/notes/node\u modules/express/lib/response.js:1004:10)位于object.exports.renderfile(/home/el8le/workspace/notes/node\u modules/jade/lib/index.js:374:12)位于view.exports.\u express[作为引擎](/home/el8le/workspace/notes/node\u modules/jade/lib/index.js:417:11)位于view.render(/home/el8le/workspace/notes/node_modules/express/lib/view.js:135:8)在tryrender(/home/el8le/workspace/notes/node_modules/express/lib/application.js:640:10)在function.render(/home/el8le/workspace/notes/node_modules/express/lib/application.js:592:3)在serverresponse.render(/home/el8le/workspace/notes/node_modules/express/lib/response.js:1008:7)at/home/el8le/workspace/notes/app.js:40:7 at layer.handle_error(/home/el8le/workspace/notes/node_modules/express/lib/router/layer.js:71:5)at trim_prefix(/home/el8le/workspace/notes/node_modules/express/lib/router/index.js:315:13)at/home/el8le/workspace/notes/node\u modules/express/lib/router/index.js:284:7

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题