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

Server constructor mutates global state #1348

Closed
retrohacker opened this issue May 15, 2017 · 3 comments
Closed

Server constructor mutates global state #1348

retrohacker opened this issue May 15, 2017 · 3 comments

Comments

@retrohacker
Copy link
Member

  • [ X ] Used appropriate template for the issue type
  • [ X ] Searched both open and closed issues for duplicates of this issue
  • [ X ] Title adequately and concisely reflects the feature or the bug

Bug Report

Restify Version

5.x

Node.js Version

All

Expected behaviour

Constructor should only effect the object being instantiated

Actual behaviour

Constructor effects all future server objects

Cause

https://github.com/restify/node-restify/blob/5.x/lib/server.js#L306-L311

Since PROXY_EVENTS are shared between every instance of a restify server, and upgrade is added but never removed, all future instances of Server will have the upgrade event proxied.

Are you willing and able to fix this?

Yes. It seems the fix should be to make PROXY_EVENTS local.

@DonutEspresso
Copy link
Member

Nice catch, code certainly reads like this is the case.

@akoserwal
Copy link
Contributor

@DonutEspresso : we can close this issue now.

@DonutEspresso
Copy link
Member

Fixed by #1661

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

No branches or pull requests

4 participants