Closed encojosh closed 8 years ago
Thanks for filing the issue. I'll try to get to fixing it later today and add unit tests for it :D
Sorry! I've been super busy and haven't had time to get to this. Ideally, it'd just be a fix where we replace ([\d\w]+/)
with ([^\/#+]+)
. A pull request with this change would be very much appreciated. And bonus points if you add a unit test for it.
No problem. Like I said previously, I am not very good with regex. Does this effectively mean anything except a / is captured? I knew that would be the right way to go but I didn't know how to create the regex. Additionally, would that regex need to be modified for the # wildcard?
I can create a pull request, but I may not have enough time to do proper unit testing.
Yeah, basically the regex will match everything except /
#
and +
, so basically everything that isn't special to the path. In terms of unit tests, it'd be nice to just have one that has a parameter with some sort of special character like _
or .
, and then check to see that the parameter is captured properly.
Sorry it took so long. Should be good now.
If the parameter contains a period or an underscore (and probably some more characters), the params argument is undefined. I'm not great with regular expressions, but changing the regex from ([\d\w]+/) to ([\d\w._]+/) fixes the problem for me, but I'm sure that their are other special characters that cause problems.
emitter.on("config/GET/+version", function (message, params, topic) { //params is undefined });
emitter.emit("config/GET/1.2.3", message);