Jugendhackt / JugendhacktApp

A friendly Jugend hackt App!
MIT License
4 stars 0 forks source link

[ERR_HTTP_HEADERS_SENT] #21

Closed LarsVomMars closed 5 years ago

LarsVomMars commented 5 years ago

Fix Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

This error should be investigated further. It occurs on multiple paths/actions.

Add your occurrences:

Some material

marvinborner commented 5 years ago

This is quite obvious and I have fixed it before in 795c813b999c54821285d9d938f796d4fae7a5ec but you changed it back again: If an error occurred you can't use res.json/res.send as these would set the headers again.

LarsVomMars commented 5 years ago

At least for me this hasn't been working either. But it also occurred in dbController.js somewhere i cannot remember atm

LarsVomMars commented 5 years ago

After some testing around again it didn't occur at all