url_scrubber 0.8.10 → 0.8.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/url_scrubber/version.rb +1 -1
- data/lib/url_scrubber.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmJkNTc2MWQ5NmU0NWNkMTZhMmE1NDZmOTFmMGRjOGE4NDc3ZjJkMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmYzMDIzNTE1OGIxZWM3ZTRhZmE0NGE2NzI2YmIzZWIzZDJhNWQ0ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWZjMGY0YmVhZDM3OThhZjExNDAzMWUyYzlkYjdlMzg3N2Q0MWM0MGM3ZTkx
|
10
|
+
MWY2Yzk1Y2FmZTMyODVhNjFlMDg2OWU0ODc5OTQ0N2ViZGEyMTNhZmQyNDU2
|
11
|
+
NmI2MmE5NzRmMzQ2YWYyY2I1N2IyMTU3ZWQzYzU1ZGM3YWZiMTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzBkOTY2YjQ0ZDFiOGViNGEzNDMxYzM2YmVhYWZkMWFkMWZkOTg3ZGY4YTFj
|
14
|
+
NWIyZmI0N2E3ZDZlZGQ4OWZlYThiMzhlMWFiNWZkOTBhMzYxZTdmMjkxM2U0
|
15
|
+
ZjZkNDAxZjU2NDY3OGUwZjk2MDQxN2IyZjE0YzRiYjUwMTRmYmU=
|
data/lib/url_scrubber/version.rb
CHANGED
data/lib/url_scrubber.rb
CHANGED
@@ -152,7 +152,7 @@ module UrlScrubber
|
|
152
152
|
# 3. valid uri as determined by Addressable::URI
|
153
153
|
def self.valid_url?(url)
|
154
154
|
schemes = %w(http https)
|
155
|
-
parsed = URI.parse(url) or return false
|
155
|
+
parsed = URI.parse(URI.escape(url)) or return false
|
156
156
|
schemes.include?(parsed.scheme) && !url.include?("@")
|
157
157
|
rescue URI::InvalidURIError
|
158
158
|
false
|
@@ -161,7 +161,7 @@ module UrlScrubber
|
|
161
161
|
|
162
162
|
def self.maps_to_public_url(url)
|
163
163
|
scrubbed = scrub(url)
|
164
|
-
parsed = URI.parse(url) or return nil
|
164
|
+
parsed = URI.parse(URI.escape(url)) or return nil
|
165
165
|
host = Domainatrix.parse(parsed.host)
|
166
166
|
if host.domain == "facebook" && host.subdomain == "business"
|
167
167
|
public_url = scrubbed.sub("http://business.facebook.com", "http://facebook.com")
|
@@ -436,7 +436,7 @@ module UrlScrubber
|
|
436
436
|
uri_str_new = uri_str_new.sub('https://', 'https://www.') if !uri_str_new.include?("https://www.")
|
437
437
|
|
438
438
|
begin
|
439
|
-
url = URI.parse(uri_str_new)
|
439
|
+
url = URI.parse(URI.escape(uri_str_new))
|
440
440
|
rescue URI::InvalidURIError => e
|
441
441
|
return [uri_str_new, CustomError.new(786, "Invalid URI #{uri_str_new} : #{e.message}") ]
|
442
442
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url_scrubber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin Langton
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-
|
14
|
+
date: 2018-05-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|