focus-ios icon indicating copy to clipboard operation
focus-ios copied to clipboard

Improve URLExtensions.isIPv4/isIPv6

Open st3fan opened this issue 3 years ago • 2 comments

In URLExtensions.swift we have isIPv4 and isIPv6 functions. The first uses a regex and the second just checks for the presence of a : in the string. Let's replace this with a call to inet_pton() to let the OS parse the address instead - delegating to a trusted OS function will be more robust.

Example at https://stackoverflow.com/questions/35056268/how-to-use-swift-convert-string-to-ipv6-addr

As part of this work, let's also start a URLExtensionsTests.swift in which we can test these two functions.

st3fan avatar Jan 07 '22 14:01 st3fan

Interested

dtee1 avatar Jan 08 '22 02:01 dtee1

Is someone still working on this issue?

Tausifqureshi786 avatar Aug 04 '22 02:08 Tausifqureshi786

Hello, would like to know if this issue still opens? If yes I am interested to work on it, thanks.

tommyming avatar May 02 '23 09:05 tommyming