mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 18:26:16 +01:00
merge
This commit is contained in:
@@ -33,9 +33,8 @@ package sonia.scm.plugin;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* The WebResourceLoader is able to load web resources. The resources are loaded
|
||||
@@ -53,9 +52,11 @@ public interface WebResourceLoader
|
||||
* Returns a {@link URL} for the given path. The method will return null if no
|
||||
* resources could be found for the given path.
|
||||
*
|
||||
* Note: The path is a web path and uses "/" as path separator
|
||||
*
|
||||
* @param path resource path
|
||||
*
|
||||
* @return url object for the given path or null
|
||||
*/
|
||||
public URL getResource(String path);
|
||||
URL getResource(String path);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package sonia.scm.util;
|
||||
|
||||
public class CRLFInjectionException extends IllegalArgumentException{
|
||||
|
||||
public CRLFInjectionException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -344,8 +344,7 @@ public final class HttpUtil
|
||||
"parameter \"{}\" contains a character which could be an indicator for a crlf injection",
|
||||
parameter);
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"parameter contains an illegal character");
|
||||
throw new CRLFInjectionException("parameter contains an illegal character");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ public class VndMediaType {
|
||||
private static final String SUBTYPE_PREFIX = "vnd.scmm-";
|
||||
public static final String PREFIX = TYPE + "/" + SUBTYPE_PREFIX;
|
||||
public static final String SUFFIX = "+json;v=" + VERSION;
|
||||
public static final String PLAIN_TEXT_PREFIX = "text/" + SUBTYPE_PREFIX;
|
||||
public static final String PLAIN_TEXT_SUFFIX = "+plain;v=" + VERSION;
|
||||
|
||||
public static final String USER = PREFIX + "user" + SUFFIX;
|
||||
public static final String GROUP = PREFIX + "group" + SUFFIX;
|
||||
@@ -23,6 +25,7 @@ public class VndMediaType {
|
||||
public static final String TAG = PREFIX + "tag" + SUFFIX;
|
||||
public static final String TAG_COLLECTION = PREFIX + "tagCollection" + SUFFIX;
|
||||
public static final String BRANCH = PREFIX + "branch" + SUFFIX;
|
||||
public static final String DIFF = PLAIN_TEXT_PREFIX + "diff" + PLAIN_TEXT_SUFFIX;
|
||||
public static final String USER_COLLECTION = PREFIX + "userCollection" + SUFFIX;
|
||||
public static final String GROUP_COLLECTION = PREFIX + "groupCollection" + SUFFIX;
|
||||
public static final String REPOSITORY_COLLECTION = PREFIX + "repositoryCollection" + SUFFIX;
|
||||
|
||||
Reference in New Issue
Block a user