I have a web application written in nodejs and expressjs. My application has many cookies for different businesses, recently i get 400 error because of the length of request header. for every request these many cookies are sent to server. I want to catch 400 error in expressJs and want to delete the cookies. Is this a good way to fix this bug ?
this is my app.js file :
import bodyParser from "body-parser";
import WebSettings from "core/settings/webSettings";
import express from "express";
import yields from "express-yields";
import open from "open";
import homeController from "ui/web/controllers/homeController";
const port = process.env.PORT || WebSettings.port;
const app = express();
app.get("/", function* (req, res) {
});
app.listen(port, '0.0.0.0', () => {
if (process.env.NODE_ENV === 'development') {
open(`http://localhost:${port}`);
}
});