hancock_cms_goto 1.0.1 → 1.0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hancock/goto/middleware.rb +3 -4
- data/lib/hancock/goto/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: 68c7d2016e3b3c6e51a5ab4a166c87827df82d9c
|
4
|
+
data.tar.gz: 5e8c479b149b15720fa51e98ca41f9d17851d0b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 287aff51b11284a69f262eea6b89985bbe104467c744a6b4c08f27512c9bfa1ac6847a97b7b107097e591ffe7a031305707a6c6145215d77217f85e908ae0d00
|
7
|
+
data.tar.gz: e0609a0ca7248a06cd0317fe4b7ac6c62b8b7756ee8ac5827afc44a2b2425feb1fd831b468274a0a3f341ff1fafd342c44643ce4b5717d26063661a39214aee7
|
@@ -31,7 +31,6 @@ module Hancock::Goto
|
|
31
31
|
|
32
32
|
if should_process?(status, headers)
|
33
33
|
begin
|
34
|
-
_body = response.body
|
35
34
|
content = extract_content(response)
|
36
35
|
doc = ::Nokogiri::HTML(content)
|
37
36
|
array = doc.css(Hancock::Goto.config.css_selector)
|
@@ -60,8 +59,8 @@ module Hancock::Goto
|
|
60
59
|
headers['content-length'] = bytesize(content).to_s
|
61
60
|
response = [content]
|
62
61
|
rescue Exception => ex
|
63
|
-
puts ex.message
|
64
|
-
puts ex.backtrace
|
62
|
+
# puts ex.message
|
63
|
+
# puts ex.backtrace
|
65
64
|
end
|
66
65
|
end
|
67
66
|
|
@@ -77,7 +76,7 @@ module Hancock::Goto
|
|
77
76
|
end
|
78
77
|
|
79
78
|
def extract_content(response)
|
80
|
-
response.body
|
79
|
+
response.is_a?(Array) ? response.first : response.body
|
81
80
|
end
|
82
81
|
|
83
82
|
def check_attr(a, attr_name)
|
data/lib/hancock/goto/version.rb
CHANGED