Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added a new test for a common QSA problem

  • Loading branch information...
commit b058ca8fced7b079fd89c25242f6d279b889a8c5 1 parent 9ef547a
@nberardi nberardi authored
Showing with 20 additions and 1 deletion.
  1. +20 −1 test/ManagedFusion.Rewriter.Tests/CommonProblemTest.cs
View
21 test/ManagedFusion.Rewriter.Tests/CommonProblemTest.cs
@@ -28,5 +28,24 @@ public void VariableDoubleProcessingNotAllowed()
Assert.AreEqual(expected, result);
}
+
+ [Test]
+ public void AddQueryStringParameterOnToUrlThatContainsQueryString()
+ {
+ var target = CreateRuleSet(@"
+RewriteRule ^/(.*)$ /$1?test=added [QSA]");
+
+ var url = new Uri("http://somesite.com/pass?test=1&test=2&test=3");
+ var context = HttpHelpers.MockHttpContext(url);
+ context.Request.SetServerVariables(new Dictionary<string,string> {
+ { "QUERY_STRING", "test=1&test=2&test=3" },
+ { "HTTP_HOST", "somesite.com" }
+ });
+
+ Uri expected = new Uri("http://somesite.com/pass?test=added&test=1&test=2&test=3");
+ Uri result = target.RunRules(context, url);
+
+ Assert.AreEqual(expected, result);
+ }
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.