diff options
author | Eric Wong <normalperson@yhbt.net> | 2012-06-22 12:59:35 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2012-06-22 12:59:35 -0700 |
commit | cdcea00891576bc852ca48b717497b659a0a8fea (patch) | |
tree | 51e1f045fcc95ab68958b2a41f84b5fa6facbdd3 | |
parent | df321f5c64e584ea16bcd440ba8e56dde359d1e7 (diff) | |
download | omgf-cdcea00891576bc852ca48b717497b659a0a8fea.tar.gz |
hysterical: redundant URLs do not exist in X-Alt-Location
Kills a line of useless code and we have a test case to validate the uselessness of the removed line.
-rw-r--r-- | lib/omgf/hysterical_raisins.rb | 1 | ||||
-rw-r--r-- | test/test_hysterical_raisins.rb | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/omgf/hysterical_raisins.rb b/lib/omgf/hysterical_raisins.rb index f315f48..6743e6b 100644 --- a/lib/omgf/hysterical_raisins.rb +++ b/lib/omgf/hysterical_raisins.rb @@ -123,7 +123,6 @@ class OMGF::HystericalRaisins } unless reproxy?(env, key, h, location) - uris -= [ dest ] uris.each_with_index { |uri,i| h["X-Alt-Location-#{i}"] = uri.to_s } end [ 302, h, [] ] diff --git a/test/test_hysterical_raisins.rb b/test/test_hysterical_raisins.rb index 56fb768..fa8ba3b 100644 --- a/test/test_hysterical_raisins.rb +++ b/test/test_hysterical_raisins.rb @@ -193,6 +193,12 @@ class TestHystericalRaisins < Test::Unit::TestCase end assert_kind_of String, resp["X-URL-1"] assert_equal "BLAH", open(resp["X-URL-1"]).read + + # Location should not be in X-Alt-Location, too + resp = @req.get("/testdom/key", @opts) + assert_kind_of URI, URI(resp["Location"]) + assert_kind_of URI, URI(resp["X-Alt-Location-0"]) + assert_nil resp["X-Alt-Location-1"] end reproxy_test |