|
@@ -7,10 +7,7 @@ import org.springframework.web.context.request.RequestContextHolder;
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.Hashtable;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
|
|
|
public class RequestUtil {
|
|
|
public final static String APP_ID = "appid";
|
|
@@ -57,6 +54,17 @@ public class RequestUtil {
|
|
|
HttpServletRequest request = requestAttributes.getRequest();
|
|
|
return request.getHeader(headerName);
|
|
|
}
|
|
|
+ public static Map<String, String> getHeaders() {
|
|
|
+ ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
|
|
|
+ HttpServletRequest request = requestAttributes.getRequest();
|
|
|
+ Enumeration<String> headerNames = request.getHeaderNames();
|
|
|
+ Map<String,String> headers = new HashMap<>();
|
|
|
+ while (headerNames.hasMoreElements()) {
|
|
|
+ String element = headerNames.nextElement();
|
|
|
+ headers.put(element,request.getHeader(element));
|
|
|
+ }
|
|
|
+ return headers;
|
|
|
+ }
|
|
|
|
|
|
public static String getAppId() throws Exception {
|
|
|
String session = getSessionId();
|