Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Can't set headers after they are sent #4

Open
conorgil opened this issue Apr 1, 2014 · 3 comments
Open

Error: Can't set headers after they are sent #4

conorgil opened this issue Apr 1, 2014 · 3 comments

Comments

@conorgil
Copy link

conorgil commented Apr 1, 2014

I have been trying to debug an error in my app for quite a while now and decided to run the example in this repo to reset my head and understand how everything should be hooked up correctly. However, when I ran the demo in this app, it spat out the same error that I am seeing in my app:

Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (http.js:691:11)
    at ServerResponse.res.setHeader (passport-yahoo/examples/signon/node_modules/express/node_modules/connect/lib/patch.js:63:22)
    at next (passport-yahoo/examples/signon/node_modules/express/node_modules/connect/lib/proto.js:156:13)
    at pass (passport-yahoo/examples/signon/node_modules/express/lib/router/index.js:110:24)
    at nextRoute (passport-yahoo/examples/signon/node_modules/express/lib/router/index.js:100:7)
    at callbacks (passport-yahoo/examples/signon/node_modules/express/lib/router/index.js:167:11)
    at complete (passport-yahoo/examples/signon/node_modules/passport/lib/middleware/authenticate.js:243:13)
    at passport-yahoo/examples/signon/node_modules/passport/lib/middleware/authenticate.js:250:15
    at pass (passport-yahoo/examples/signon/node_modules/passport/lib/authenticator.js:427:14)
    at Authenticator.transformAuthInfo (passport-yahoo/examples/signon/node_modules/passport/lib/authenticator.js:449:5)

Yahoo OpenID has been experiencing issues for a while, but shouldn't the passport module gracefully propagate this error up through the stack so that my next error handler middleware can handle the error correctly (redirect to an error page, for example).

After some googling, I reviewed the following pages (among others) and think I have my error handling setup correctly for once the passport module propagates the error up:

Any thoughts?

@conorgil
Copy link
Author

ping

@jpalardy
Copy link

Same problem. I found this by looking for "Can't set headers after they are sent."

@jpalardy
Copy link

The latest openid commit fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants