Skip to content

Commit b1dad72

Browse files
committed
Merged #100 "Can't clone a repository with a + character in the name"
2 parents 65a6f62 + 46bfccb commit b1dad72

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/main/java/com/gitblit/servlet/AuthenticationFilter.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
package com.gitblit.servlet;
1717

1818
import java.io.IOException;
19-
import java.io.UnsupportedEncodingException;
20-
import java.net.URLDecoder;
2119
import java.security.Principal;
2220
import java.util.Enumeration;
2321
import java.util.HashMap;
@@ -102,12 +100,6 @@ protected String getFullUrl(HttpServletRequest httpRequest) {
102100
url = url.substring(1);
103101
}
104102
String fullUrl = url + (StringUtils.isEmpty(params) ? "" : ("?" + params));
105-
try {
106-
fullUrl = URLDecoder.decode(fullUrl, "UTF-8");
107-
} catch (UnsupportedEncodingException e) {
108-
logger.warn("UTF-8 decoding of URL failed: "+fullUrl, e);
109-
e.printStackTrace();
110-
}
111103
return fullUrl;
112104
}
113105

src/main/java/com/gitblit/utils/StringUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ public static String encodeURL(String inStr) {
129129
retStr.append("%20");
130130
} else if (inStr.charAt(i) == '&') {
131131
retStr.append("%26");
132+
} else if (inStr.charAt(i) == '+') {
133+
retStr.append("%2B");
132134
} else {
133135
retStr.append(inStr.charAt(i));
134136
}
@@ -398,7 +400,7 @@ public static List<String> getStringsFromValue(String value, String separator) {
398400
* @return the first invalid character found or null if string is acceptable
399401
*/
400402
public static Character findInvalidCharacter(String name) {
401-
char[] validChars = { '/', '.', '_', '-', '~' };
403+
char[] validChars = { '/', '.', '_', '-', '~', '+' };
402404
for (char c : name.toCharArray()) {
403405
if (!Character.isLetterOrDigit(c)) {
404406
boolean ok = false;

src/site/administration.mkd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All repository settings are stored within the repository `.git/config` file unde
2020
federationSets =
2121

2222
#### Repository Names
23-
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/>
23+
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/>
2424
Whitespace is illegal.
2525

2626
Repositories can be grouped within subfolders. e.g. *libraries/mycoollib.git* and *libraries/myotherlib.git*

0 commit comments

Comments
 (0)