Open Bug 746104 Opened 13 years ago Updated 2 years ago

Expose a better util (like PR_StringToNetAddr) to js to recognize valid IP addresses

Categories

(Core :: Networking, defect, P5)

defect

Tracking

()

People

(Reporter: mak, Unassigned)

Details

(Whiteboard: [necko-would-take])

A possible method to use today is try { Services.eTLD.getBaseDomainFromHost(aHost); } catch (e if e.result == Cr.NS_ERROR_HOST_IS_IP_ADDRESS) { // it's an IP address. } Or one may cook up a regex for ipv4 and v6. This is not much elegant, having something exposed to js like PR_StringToNetAddr could be better.
Whiteboard: [necko-would-take]
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.