You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wink.apache.org by bl...@apache.org on 2009/09/09 18:28:07 UTC
svn commit: r813038 -
/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java
Author: bluk
Date: Wed Sep 9 16:28:06 2009
New Revision: 813038
URL: http://svn.apache.org/viewvc?rev=813038&view=rev
Log:
Skip path normalization if there are no evil paths
See [WINK-173]
Modified:
incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java
Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java?rev=813038&r1=813037&r2=813038&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java (original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/uri/UriPathNormalizer.java Wed Sep 9 16:28:06 2009
@@ -41,6 +41,10 @@
* @return normalize path
*/
public static String normalize(String path) {
+ if ((path != null) && (path.indexOf(".") == -1) && (path.indexOf("//") == -1)) {
+ return path;
+ }
+
boolean wasNormalized = true;
// 1. count number of nonempty segments in path
@@ -55,7 +59,7 @@
// empty segment? (two adjacent slashes?)
if (slash == src) {
if (src != lastChar) { // ignore the first slash occurence
- // (when numSegments == 0)
+ // (when numSegments == 0)
wasNormalized = false;
}
} else {