سؤال

I'm getting an error when I try to use restify with connect session middleware. The session middleware expects req.originalUrl but restify doesnt set that property. (It only sets req.url) That is causing an exception in the session code. Is there any workaround for this?

Thanks, Sharath

هل كانت مفيدة؟

المحلول

can you just set it yourself?

app.use(function(req, res, next){
  req.originalUrl = req.url;
  next();
});
app.use(connect.session({secret:'foo'});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top