summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-06-12 17:00:06 -0600
committerJames Moger <james.moger@gitblit.com>2014-06-12 17:00:06 -0600
commitb1dad726772a277924ff7ced0e26dc443962edcf (patch)
treea9ec84525ca3c583287e0ed623bcf1efd65d1149
parent65a6f622001a2596befb4dd0a07ce11cb9224d2e (diff)
parent46bfccb0d57ba75d195be7afa54e37ba0d4321d1 (diff)
downloadgitblit-b1dad726772a277924ff7ced0e26dc443962edcf.tar.gz
gitblit-b1dad726772a277924ff7ced0e26dc443962edcf.zip
Merged #100 "Can't clone a repository with a + character in the name"
-rw-r--r--src/main/java/com/gitblit/servlet/AuthenticationFilter.java8
-rw-r--r--src/main/java/com/gitblit/utils/StringUtils.java4
-rw-r--r--src/site/administration.mkd2
3 files changed, 4 insertions, 10 deletions
diff --git a/src/main/java/com/gitblit/servlet/AuthenticationFilter.java b/src/main/java/com/gitblit/servlet/AuthenticationFilter.java
index dd821ac7..ddb85f49 100644
--- a/src/main/java/com/gitblit/servlet/AuthenticationFilter.java
+++ b/src/main/java/com/gitblit/servlet/AuthenticationFilter.java
@@ -16,8 +16,6 @@
package com.gitblit.servlet;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
import java.security.Principal;
import java.util.Enumeration;
import java.util.HashMap;
@@ -102,12 +100,6 @@ public abstract class AuthenticationFilter extends DaggerFilter {
url = url.substring(1);
}
String fullUrl = url + (StringUtils.isEmpty(params) ? "" : ("?" + params));
- try {
- fullUrl = URLDecoder.decode(fullUrl, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- logger.warn("UTF-8 decoding of URL failed: "+fullUrl, e);
- e.printStackTrace();
- }
return fullUrl;
}
diff --git a/src/main/java/com/gitblit/utils/StringUtils.java b/src/main/java/com/gitblit/utils/StringUtils.java
index d7e1ea3d..087de543 100644
--- a/src/main/java/com/gitblit/utils/StringUtils.java
+++ b/src/main/java/com/gitblit/utils/StringUtils.java
@@ -129,6 +129,8 @@ public class StringUtils {
retStr.append("%20");
} else if (inStr.charAt(i) == '&') {
retStr.append("%26");
+ } else if (inStr.charAt(i) == '+') {
+ retStr.append("%2B");
} else {
retStr.append(inStr.charAt(i));
}
@@ -398,7 +400,7 @@ public class StringUtils {
* @return the first invalid character found or null if string is acceptable
*/
public static Character findInvalidCharacter(String name) {
- char[] validChars = { '/', '.', '_', '-', '~' };
+ char[] validChars = { '/', '.', '_', '-', '~', '+' };
for (char c : name.toCharArray()) {
if (!Character.isLetterOrDigit(c)) {
boolean ok = false;
diff --git a/src/site/administration.mkd b/src/site/administration.mkd
index 6fc334e4..049a8273 100644
--- a/src/site/administration.mkd
+++ b/src/site/administration.mkd
@@ -20,7 +20,7 @@ All repository settings are stored within the repository `.git/config` file unde
federationSets =
#### Repository Names
-Repository names must be case-insensitive-unique but are CASE-SENSITIVE ON CASE-SENSITIVE FILESYSTEMS. The name must be composed of letters, digits, or `/ _ - . ~`<br/>
+Repository names must be case-insensitive-unique but are CASE-SENSITIVE ON CASE-SENSITIVE FILESYSTEMS. The name must be composed of letters, digits, or `/ _ - . ~ +`<br/>
Whitespace is illegal.
Repositories can be grouped within subfolders. e.g. *libraries/mycoollib.git* and *libraries/myotherlib.git*