private_address_check 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of private_address_check might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a083cb52ac474ff6cf8ce66319809d17fa577fa3
|
4
|
+
data.tar.gz: 48f618961a48b3af93a1c1985b50538bcc1edaff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66da1452e9f52d5ae201a8717d13142589f5df45562815755a169fcacd028be29f18e6ecedd66530ef8139852331d3f4ca8645b90d338cca0d91b3078ec8bb60
|
7
|
+
data.tar.gz: 36c62e3ab8a039711793fa6bd1ea655942d4dec9a03bb863c21f561ebb1fe00d1e73402e69d8bf58ecebabc753f701add6201fdc8f8145e35460ce0ea96a37e3
|
data/README.md
CHANGED
@@ -41,7 +41,7 @@ PrivateAddressCheck.resolves_to_private_address?("localhost") # => true
|
|
41
41
|
|
42
42
|
require "private_address_check/tcpsocket_ext"
|
43
43
|
require "net/http"
|
44
|
-
require "
|
44
|
+
require "uri"
|
45
45
|
|
46
46
|
Net::HTTP.get_response(URI.parse("http://192.168.1.1")) # => attempts connection like normal
|
47
47
|
|
@@ -13,12 +13,11 @@ module PrivateAddressCheck
|
|
13
13
|
module TCPSocketExt
|
14
14
|
def initialize(remote_host, remote_port, local_host = nil, local_port = nil)
|
15
15
|
if Thread.current[:private_address_check]
|
16
|
-
|
17
|
-
if PrivateAddressCheck.private_address?(ip)
|
16
|
+
if PrivateAddressCheck.resolves_to_private_address?(remote_host)
|
18
17
|
raise PrivateAddressCheck::PrivateConnectionAttemptedError
|
19
18
|
end
|
20
19
|
|
21
|
-
super(
|
20
|
+
super(remote_host, remote_port, local_host, local_port)
|
22
21
|
else
|
23
22
|
super
|
24
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: private_address_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Downey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,8 +68,8 @@ files:
|
|
68
68
|
- lib/private_address_check.rb
|
69
69
|
- lib/private_address_check/tcpsocket_ext.rb
|
70
70
|
- lib/private_address_check/version.rb
|
71
|
+
- test/private_address_check/tcpsocket_ext_test.rb
|
71
72
|
- test/private_address_check_test.rb
|
72
|
-
- test/tcpsocket_ext_test.rb
|
73
73
|
- test/test_helper.rb
|
74
74
|
homepage: https://github.com/jtdowney/private_address_check
|
75
75
|
licenses:
|