labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r748062 - in /labs/magma/trunk/foundation-website/src: main/java/org/apache/magma/website/utils/URLRewritingStream.java test/java/org/apache/magma/website/utils/RewritingTest.java test/java/org/apache/magma/website/utils/RewritingTests.java
Date Thu, 26 Feb 2009 09:07:00 GMT
Author: simoneg
Date: Thu Feb 26 09:06:59 2009
New Revision: 748062

URL: http://svn.apache.org/viewvc?rev=748062&view=rev
Log:
LABS-269 : handle all type of protocols

Added:
    labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTest.java
  (contents, props changed)
      - copied, changed from r735585, labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTests.java
Removed:
    labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTests.java
Modified:
    labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/utils/URLRewritingStream.java

Modified: labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/utils/URLRewritingStream.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/utils/URLRewritingStream.java?rev=748062&r1=748061&r2=748062&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/utils/URLRewritingStream.java
(original)
+++ labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/utils/URLRewritingStream.java
Thu Feb 26 09:06:59 2009
@@ -110,8 +110,7 @@
 				stpos++;
 			}
 			String accontent = new String(intbuff, chop ? 1 : 0, intbuffpos);
-			// TODO this should exlude every proto: excedpt magma
-			if (!accontent.startsWith("/") && !accontent.startsWith("http:/") && !accontent.startsWith("mailto:")
&& !accontent.startsWith("javascript:") && !accontent.startsWith("#")) {
+			if (accontent.startsWith("magma:") || (!accontent.startsWith("/") && accontent.indexOf(':')
== -1 && !accontent.startsWith("#"))) {
 				if (accontent.startsWith("magma:")) {
 					send(this.commonPrefix);
 					stpos+=7;

Copied: labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTest.java
(from r735585, labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTests.java)
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTest.java?p2=labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTest.java&p1=labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTests.java&r1=735585&r2=748062&rev=748062&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTests.java
(original)
+++ labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTest.java
Thu Feb 26 09:06:59 2009
@@ -29,13 +29,16 @@
 import org.junit.runner.RunWith;
 
 @RunWith(Theories.class)
-public class RewritingTests {
+public class RewritingTest {
 	@DataPoint
 	public static final String[] 
 	SET1 = {"<a href=\"ciao\">test</a>", "<a href=\"/context/current/place/ciao\">test</a>"},
 	SET2 = {"<a href=ciao>test</a>", "<a href=/context/current/place/ciao>test</a>"},
 	SET3 = {"<a href=\"/ciao\">test</a>", "<a href=\"/ciao\">test</a>"},
 	SET4 = {"<a href=\"http://ciao\">test</a>", "<a href=\"http://ciao\">test</a>"},
+	SET4b = {"<a href=\"javascript:ciao\">test</a>", "<a href=\"javascript:ciao\">test</a>"},
+	SET4c = {"<a href=\"ftp://ciao\">test</a>", "<a href=\"ftp://ciao\">test</a>"},
+	SET4d = {"<a href=\"mailto:simoneg@apache.org\">test</a>", "<a href=\"mailto:simoneg@apache.org\">test</a>"},
 	SET5 = {"<a href=\"ciaociaociaociao?src=ciao\">test</a>", "<a href=\"/context/current/place/ciaociaociaociao?src=ciao\">test</a>"},
 	SET6 = {"<a src=\"ciaociaociaociao\" href=\"ciao\">test</a>", "<a src=\"/context/current/place/ciaociaociaociao\"
href=\"ciao\">test</a>"},
 	SET7 = {"<link href=\"magma:template/subtest.css\"/>", "<link href=\"/context/template/dummy/subtest.css\"/>"},

Propchange: labs/magma/trunk/foundation-website/src/test/java/org/apache/magma/website/utils/RewritingTest.java
------------------------------------------------------------------------------
    svn:mergeinfo = 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message