summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-03-30 21:37:44 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2010-03-30 21:37:44 -0700
commitb124481fa620f054dacb76884da1c58764f5fb14 (patch)
tree353092413194ce08202c82586961ca0af0000b36 /src
parent4fdeaa29980aaf084ecc458292945f261d4d9eb2 (diff)
downloadDotNetOpenAuth-b124481fa620f054dacb76884da1c58764f5fb14.zip
DotNetOpenAuth-b124481fa620f054dacb76884da1c58764f5fb14.tar.gz
DotNetOpenAuth-b124481fa620f054dacb76884da1c58764f5fb14.tar.bz2
Added another test narrowing down the interoperability problem with Yahoo.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs b/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs
index 73c185e..bfdc1a1 100644
--- a/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs
@@ -150,6 +150,28 @@ namespace DotNetOpenAuth.Test.OpenId {
Assert.AreEqual("https://host:80/PaTH?KeY=VaLUE#fRag", id.ToString());
}
+ /// <summary>
+ /// Verifies that URIs that contain base64 encoded path segments (such as Yahoo) are properly preserved.
+ /// </summary>
+ /// <remarks>
+ /// Yahoo includes a base64 encoded part as their last path segment,
+ /// which may end with a period. The default .NET Uri parser trims off
+ /// trailing periods, which breaks OpenID unless special precautions are taken.
+ /// </remarks>
+ [TestCase]
+ public void TrailingPeriodsNotTrimmed() {
+ string claimedIdentifier = "https://me.yahoo.com/a/AsDf.#asdf";
+ Identifier id = claimedIdentifier;
+ Assert.AreEqual(claimedIdentifier, id.OriginalString);
+ Assert.AreEqual(claimedIdentifier, id.ToString());
+
+ UriIdentifier idUri = new UriIdentifier(claimedIdentifier);
+ Assert.AreEqual(claimedIdentifier, idUri.OriginalString);
+ Assert.AreEqual(claimedIdentifier, idUri.ToString());
+ Assert.AreEqual(claimedIdentifier, idUri.Uri.AbsoluteUri);
+ Assert.AreEqual(Uri.UriSchemeHttps, idUri.Uri.Scheme); // in case custom scheme tricks are played, this must still match
+ }
+
[TestCase]
public void HttpSchemePrepended() {
UriIdentifier id = new UriIdentifier("www.yahoo.com");