html-proofer 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/html/proofer/check.rb +10 -2
- data/lib/html/proofer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 251947156251aad2dfb34f8f05b24fe387c34b79
|
4
|
+
data.tar.gz: 0b1ef3155efa7036f09db41e0cd4689002cdf318
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9de89df3791ddb7d945fe5e6624fb18db97407364ab070dd5aa0598d9d414baf276f578f2e7aec90db432596da79f4005ff1b9267093921d02c2827cd0ce88fa
|
7
|
+
data.tar.gz: 49e32043dbe5a4fd60f46da560c47185cb7319f769cde383045df9d91fcfd205a6c56266f59274d18f6c889405a5da5b0371283371a45d5129853924c81c42b2
|
data/Gemfile.lock
CHANGED
data/lib/html/proofer/check.rb
CHANGED
@@ -19,7 +19,7 @@ class HTML::Proofer::Checks
|
|
19
19
|
@options = opts
|
20
20
|
@issues = []
|
21
21
|
|
22
|
-
@hydra = Typhoeus::Hydra.
|
22
|
+
@hydra = Typhoeus::Hydra.hydra
|
23
23
|
@additional_href_ignores = @options[:href_ignore] || []
|
24
24
|
end
|
25
25
|
|
@@ -47,7 +47,15 @@ class HTML::Proofer::Checks
|
|
47
47
|
self.add_issue(issue_text + ". #{response.return_message}!")
|
48
48
|
else
|
49
49
|
response_code = response.code.to_s
|
50
|
-
|
50
|
+
if %w(420 503).include?(response_code)
|
51
|
+
# 420s usually come from rate limiting; let's ignore the query and try just the path
|
52
|
+
uri = URI(href)
|
53
|
+
response = Typhoeus.get(uri.scheme + "://" + uri.host + uri.path, {:followlocation => true})
|
54
|
+
self.add_issue("#{issue_text} Originally, this was a #{response_code}. Now, the HTTP request failed again: #{response.code.to_s}") unless response.success?
|
55
|
+
else
|
56
|
+
# Received a non-successful http response.
|
57
|
+
self.add_issue("#{issue_text} HTTP request failed: #{response_code}")
|
58
|
+
end
|
51
59
|
end
|
52
60
|
end
|
53
61
|
hydra.queue(request)
|
data/lib/html/proofer/version.rb
CHANGED