about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-06-22 12:59:35 -0700
committerEric Wong <normalperson@yhbt.net>2012-06-22 12:59:35 -0700
commitcdcea00891576bc852ca48b717497b659a0a8fea (patch)
tree51e1f045fcc95ab68958b2a41f84b5fa6facbdd3
parentdf321f5c64e584ea16bcd440ba8e56dde359d1e7 (diff)
downloadomgf-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.rb1
-rw-r--r--test/test_hysterical_raisins.rb6
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