Last active
February 15, 2016 18:02
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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