wzrdtales / socket-io-sticky-session

Sticky session balancer with layer 4 capabilities, based on a `cluster` module
72 stars 21 forks source link

Fixed: wrong IP address search in request header #15

Closed natalniy closed 8 years ago

natalniy commented 8 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search

There is one parameter in String.searh function. So search start from begining of strData variable and searchPos variable was ignored.

wzrdtales commented 8 years ago

Sorry was a bit to much in a hurry, taking a look at this later when I have more time.

wzrdtales commented 8 years ago

Ok, now I have time, yes you're right it does not take a second parameter, I think that was replaced with something else. However, I want to remove that regex and replace it with an indexOf which is way faster and this module should have the least impact possible.

wzrdtales commented 8 years ago

Merged and changed the regex to indexOf instead

wzrdtales commented 8 years ago

Thanks for reporting this!

wzrdtales commented 8 years ago

Published as + socketio-sticky-session@0.4.2