mirror of https://github.com/halo-dev/halo
Remove redundant code of http servlet request fetching globally
parent
c643e204f8
commit
0c1b32e776
|
@ -30,17 +30,6 @@ public class HaloUtils {
|
||||||
|
|
||||||
public static final String URL_SEPARATOR = "/";
|
public static final String URL_SEPARATOR = "/";
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets current http servlet request.
|
|
||||||
*
|
|
||||||
* @return current http servlet request
|
|
||||||
*/
|
|
||||||
@NonNull
|
|
||||||
public static HttpServletRequest getHttpServletRequest() {
|
|
||||||
return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes()))
|
|
||||||
.getRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public static String ensureBoth(@NonNull String string, @NonNull String bothfix) {
|
public static String ensureBoth(@NonNull String string, @NonNull String bothfix) {
|
||||||
return ensureBoth(string, bothfix, bothfix);
|
return ensureBoth(string, bothfix, bothfix);
|
||||||
|
|
Loading…
Reference in New Issue