Fix cloning repositories with + in their names
| | |
| | | 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;
|
| | |
| | | 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;
|
| | | }
|
| | |
|
| | |
| | | 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));
|
| | | }
|
| | |
| | | * @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;
|
| | |
| | | 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*
|