Skip to content
Snippets Groups Projects
Commit e378ff07 authored by Brian Sawicki's avatar Brian Sawicki
Browse files

Define PRIVATE_RANGES in IPAddr class

parent 05ea58af
No related branches found
No related tags found
No related merge requests found
...@@ -213,6 +213,12 @@ end ...@@ -213,6 +213,12 @@ end
# Code validate private/public IP acceptable ranges. # Code validate private/public IP acceptable ranges.
class IPAddr class IPAddr
PRIVATE_RANGES = [
IPAddr.new('10.0.0.0/8'),
IPAddr.new('172.16.0.0/12'),
IPAddr.new('192.168.0.0/16')
]
def private? def private?
return false unless self.ipv4? return false unless self.ipv4?
PRIVATE_RANGES.each do |ipr| PRIVATE_RANGES.each do |ipr|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment