Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 SailsJS 中,每个套接字响应都包含 JWR 标头。如何在每个套接字响应中注入我的自定义标头?
router:routeSails 中的事件可以解决这个问题:
router:route
sails.on('router:route', (route) => { var { req: request, res: response } = route; // Send `Lifted-At` header to client if (request.isSocket) { response.set('Lifted-At', sails.config.liftedAt.toUTCString()); } });