metainspector 5.1.2 → 5.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 217018e977493f4b34675983860e75428f8f69e0
4
- data.tar.gz: 6a4dd2cd43014ebbd07efa0883adcb0d3aa2df92
3
+ metadata.gz: f3d01cdc6e285149cbb1bdb8cf65ebab808da8c1
4
+ data.tar.gz: 15c37998971b8f63e6829e75049c0f1a819d570d
5
5
  SHA512:
6
- metadata.gz: 00e976815e2076b14c8ca8d551bf1f13709b3db84ca670977eb10077fe5e1e17c4bb09ae67e1d388f434d6c39e371eeb514b8f3fb1a4c07c7f5d36e9c75d546b
7
- data.tar.gz: 0b6dddcb366166ffee6b056f5ad343b2b0cc2ca30077fa861fb652c8e0a39f006a00149f44465eac66952768bf8b9b319c2d8768885018f3b39a2d776d0ff4ce
6
+ metadata.gz: 24e87ba552861135cd0e5cbf98a4f29fbe4d99b27ba4365aec9f5f5902751bda8b7e299c30a83bea3517b4efc18d8677f2278166d95f4adfff673633cf3a4408
7
+ data.tar.gz: 7585f94e0ba3639da3c2d0d534803b63929987cc43c466135a68b6c6aa0424131b33954e0e72dbec68240e9a33d369368345ced37b70d6fb74c67ee806823e62
@@ -62,7 +62,7 @@ module MetaInspector
62
62
  else
63
63
  Addressable::URI.join(base_url, url).normalize.to_s
64
64
  end
65
- rescue MetaInspector::ParserError, Addressable::URI::InvalidURIError
65
+ rescue MetaInspector::ParserError, Addressable::URI::InvalidURIError, ArgumentError
66
66
  nil
67
67
  end
68
68
 
@@ -1,3 +1,3 @@
1
1
  module MetaInspector
2
- VERSION = '5.1.2'
2
+ VERSION = '5.1.3'
3
3
  end
@@ -0,0 +1,20 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx/0.7.67
3
+ Date: Fri, 18 Nov 2011 21:46:46 GMT
4
+ Content-Type: text/html
5
+ Connection: keep-alive
6
+ Last-Modified: Mon, 14 Nov 2011 16:53:18 GMT
7
+ Content-Length: 340
8
+
9
+ <html>
10
+ <head>
11
+ <title>Sample file invalid byte sequence links</title>
12
+ </head>
13
+ <body>
14
+ <ul>
15
+ <li><a href="http://pagerankalert.posterous.com">blog</a></li>
16
+ <li><a href="http://element%b3wgarderoby.com/">invalid</a></li>
17
+ <li><a href="http://twitter.com/pagerankalert">twitter</a></li>
18
+ </ul>
19
+ </body>
20
+ </html>
@@ -105,6 +105,12 @@ describe MetaInspector do
105
105
  m = MetaInspector.new('http://example.com/invalid_href')
106
106
  expect(m.links.non_http).to eq(["skype:joeuser?call", "telnet://telnet.cdrom.com"])
107
107
  end
108
+
109
+ it "should not crash with links that have invalid byte sequence, filtering them out" do
110
+ m = MetaInspector.new('http://example.com/invalid_byte_seq')
111
+ expect(m.links.all).to eq(["http://pagerankalert.posterous.com/", "http://twitter.com/pagerankalert"])
112
+ end
113
+
108
114
  end
109
115
 
110
116
  describe 'Relative links' do
data/spec/spec_helper.rb CHANGED
@@ -73,6 +73,7 @@ FakeWeb.register_uri(:get, "http://protocol-relative.com", :response => fixture_
73
73
  FakeWeb.register_uri(:get, "https://protocol-relative.com", :response => fixture_file("protocol_relative.response"))
74
74
  FakeWeb.register_uri(:get, "http://example.com/nonhttp", :response => fixture_file("nonhttp.response"))
75
75
  FakeWeb.register_uri(:get, "http://example.com/invalid_href", :response => fixture_file("invalid_href.response"))
76
+ FakeWeb.register_uri(:get, "http://example.com/invalid_byte_seq", :response => fixture_file("invalid_byte_seq.response"))
76
77
  FakeWeb.register_uri(:get, "http://example.com/malformed_href", :response => fixture_file("malformed_href.response"))
77
78
  FakeWeb.register_uri(:get, "http://www.youtube.com/watch?v=iaGSSrp49uc", :response => fixture_file("youtube.response"))
78
79
  FakeWeb.register_uri(:get, "http://markupvalidator.com/faqs", :response => fixture_file("markupvalidator_faqs.response"))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metainspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 5.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Iniesta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-01 00:00:00.000000000 Z
11
+ date: 2016-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -317,6 +317,7 @@ files:
317
317
  - spec/fixtures/head_links.response
318
318
  - spec/fixtures/https.facebook.com.response
319
319
  - spec/fixtures/international.response
320
+ - spec/fixtures/invalid_byte_seq.response
320
321
  - spec/fixtures/invalid_href.response
321
322
  - spec/fixtures/iteh.at.response
322
323
  - spec/fixtures/largest_image_in_html.response