Skip to content
#

mozilla

Here are 473 public repositories matching this topic...

st3fan
st3fan commented Jan 7, 2022

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-ip

Improve this page

Add a description, image, and links to the mozilla topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the mozilla topic, visit your repo's landing page and select "manage topics."

Learn more