mikehale-rat-hole 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/README.rdoc +1 -1
- data/lib/rat_hole.rb +3 -3
- data/rat-hole.gemspec +1 -1
- data/test/test_rat_hole.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -20,7 +20,7 @@ You can also modify the response from the server to cleanup html tweak headers e
|
|
20
20
|
rack_request
|
21
21
|
end
|
22
22
|
|
23
|
-
def process_server_response(rack_response)
|
23
|
+
def process_server_response(rack_response, rack_request)
|
24
24
|
# For any html pages proxied replace all links with http://ronpaul.com and
|
25
25
|
# add a Ron-Paul header.
|
26
26
|
|
data/lib/rat_hole.rb
CHANGED
@@ -6,7 +6,7 @@ require 'util'
|
|
6
6
|
|
7
7
|
class RatHole
|
8
8
|
|
9
|
-
VERSION = '0.1.
|
9
|
+
VERSION = '0.1.4'
|
10
10
|
|
11
11
|
def initialize(host)
|
12
12
|
@host = host
|
@@ -16,7 +16,7 @@ class RatHole
|
|
16
16
|
rack_request
|
17
17
|
end
|
18
18
|
|
19
|
-
def process_server_response(rack_response)
|
19
|
+
def process_server_response(rack_response, rack_request)
|
20
20
|
rack_response
|
21
21
|
end
|
22
22
|
|
@@ -44,7 +44,7 @@ class RatHole
|
|
44
44
|
body = response.body || ''
|
45
45
|
headers.delete('transfer-encoding')
|
46
46
|
|
47
|
-
process_server_response(Rack::Response.new(body, code, headers)).finish
|
47
|
+
process_server_response(Rack::Response.new(body, code, headers), source_request).finish
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
data/rat-hole.gemspec
CHANGED
data/test/test_rat_hole.rb
CHANGED
@@ -209,7 +209,7 @@ class TestRatHole < Test::Unit::TestCase
|
|
209
209
|
end
|
210
210
|
|
211
211
|
class PoliticalAgendaRatHole < RatHole
|
212
|
-
def process_server_response(rack_response)
|
212
|
+
def process_server_response(rack_response, rack_request)
|
213
213
|
if(rack_response.content_type == 'text/html')
|
214
214
|
doc = Hpricot(rack_response.body.first)
|
215
215
|
(doc/"a").set('href', 'http://ronpaul.com')
|