summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/http.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2013-10-15 14:52:44 +0100
committerSteve Kemp <steve@steve.org.uk>2013-10-15 14:52:44 +0100
commite632236912029d2bbc2e5216a29eaf44aa4ffc88 (patch)
tree6e05b56a82a782e42993d3da104929978383d507 /lib/custodian/protocoltest/http.rb
parenta4705b80e24c0e6dffa6079c8a944e3311ee796a (diff)
We now allow "with cache busting", and "without cache busting".
Diffstat (limited to 'lib/custodian/protocoltest/http.rb')
-rw-r--r--lib/custodian/protocoltest/http.rb33
1 files changed, 26 insertions, 7 deletions
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index c9aedaf..f9e3b85 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -133,6 +133,17 @@ module Custodian
if ( line =~ /not following redirects?/i )
@redirect = false
end
+
+ #
+ # Do we use cache-busting?
+ #
+ @cache_busting = true
+ if ( line =~ /with\s+cache\s+busting/ )
+ @cache_busting = true
+ end
+ if ( line =~ /without\s+cache\s+busting/ )
+ @cache_busting = false
+ end
end
@@ -157,6 +168,12 @@ module Custodian
@redirect
end
+ #
+ # Do we have cache-busting?
+ #
+ def cache_busting?
+ @cache_busting
+ end
#
# Allow this test to be serialized.
@@ -192,18 +209,20 @@ module Custodian
period = settings.timeout()
#
- # The URL we'll fetch, which has a cache-busting
- # query-string
+ # The URL we'll fetch/poll.
#
test_url = @url
#
- # Parse and append a query-string if not present.
+ # Parse and append a query-string if not present, if we're
+ # running with cache-busting.
#
- u = URI.parse( test_url )
- if ( ! u.query )
- u.query = "ctime=#{Time.now.to_i}"
- test_url = u.to_s
+ if ( @cache_busting )
+ u = URI.parse( test_url )
+ if ( ! u.query )
+ u.query = "ctime=#{Time.now.to_i}"
+ test_url = u.to_s
+ end
end