Skip to content

Instantly share code, notes, and snippets.

@sukinull
Last active February 15, 2016 18:02
Show Gist options
  • Save sukinull/502402038ee5add81fe3 to your computer and use it in GitHub Desktop.
Save sukinull/502402038ee5add81fe3 to your computer and use it in GitHub Desktop.
Express 4(when use app.use()) + passport-http-oauth req.url is not req.originalUrl
/**
* There is a pull request, but not merged, https://github.com/jaredhanson/passport-http-oauth/pull/10
* I think
* ,path = req.originalUrl || req.url || '';
* may solve the problem. whatever.
*/
function originalUrlHack(req, res, next) {
if (typeof (req.originalUrl) != 'undefined' && req.url != req.originalUrl)
req.url = req.originalUrl;
next();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment