mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-24 11:35:54 +08:00
dbeaver/pro#6148 add x-origin header support (#3565)
This commit is contained in:
@@ -42,6 +42,7 @@ import java.util.*;
|
||||
|
||||
public class ServletAppUtils {
|
||||
private static final String HEADER_ORIGIN = "Origin";
|
||||
private static final String HEADER_X_ORIGIN = "X-Origin";
|
||||
private static final String HEADER_REFERER = "Referer";
|
||||
|
||||
private static final String HEADER_FORWARDED_SCHEME = "X-Forwarded-Scheme";
|
||||
@@ -287,6 +288,9 @@ public class ServletAppUtils {
|
||||
@NotNull
|
||||
public static String getOriginFromRequestOrThrow(HttpServletRequest request) throws DBWebException {
|
||||
String origin = request.getHeader(HEADER_ORIGIN);
|
||||
if (CommonUtils.isEmpty(origin)) {
|
||||
origin = request.getHeader(HEADER_X_ORIGIN);
|
||||
}
|
||||
if (CommonUtils.isEmpty(origin)) {
|
||||
origin = request.getHeader(HEADER_REFERER);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user