tryfer / node-tryfer

A Node Zipkin Tracer Library.
Apache License 2.0
44 stars 27 forks source link

Add detection for IPv6 addresses in Trace#fromRequest #38

Closed cjthompson closed 8 years ago

cjthompson commented 8 years ago

This patch is based on the other pull request to not crash on an IPv6 address. With this patch, node-tryfer is now compatible with node 4.x and 5.x. I fixed the linting issues from the previous patch and leverage the node built-in net.isIPv4 function with a fallback to a custom implementation.

One additional tweak I added was to check for IPv6 mapped IPv4 addresses and extract the IPv4 address:

    // Check IPv4 mapped IPv6 addresses
    if (/^::ffff:(\d{1,3}\.){3,3}\d{1,3}$/.test(host.address)) {
      host.address = host.address.replace(/^::ffff:/, '');
    }
9point6 commented 8 years ago

Is there any recent progress on getting this merged?

rooftopsparrow commented 8 years ago

Bump.

Kami commented 8 years ago

I quickly looked over the changes and they look good to me.

Proper review would be better though, but I don't know when I will be able to get to it. Having said that, we are happy to give write access to new people who would like to help and maintain the project.

Kami commented 8 years ago

Sorry for the delay.

I did a more in-depth review and the changes looked good to me so I went ahead and merged them into master.

Sorry for the delay again and thanks a lot for this great PR.