File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
lowcoder-infra/src/main/java/org/lowcoder/infra/event
lowcoder-server/src/main/java/org/lowcoder/api/util Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public abstract class AbstractEvent implements LowcoderEvent
17
17
protected final String userId ;
18
18
protected final String sessionHash ;
19
19
protected final Boolean isAnonymous ;
20
+ private final String ipAddress ;
20
21
protected Map <String , Object > details ;
21
22
22
23
public Map <String , Object > details ()
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public Object handleAPICallEvent(ProceedingJoinPoint joinPoint) throws Throwable
64
64
}
65
65
MultiValueMap <String , String > headers = writableHttpHeaders (request .getHeaders ());
66
66
headers .remove ("Cookie" );
67
- headers .remove ("X-Real-IP" );
67
+ String ipAddress = headers .remove ("X-Real-IP" ). stream (). findFirst (). get ( );
68
68
APICallEvent event = APICallEvent .builder ()
69
69
.userId (orgMember .getUserId ())
70
70
.orgId (orgMember .getOrgId ())
@@ -75,6 +75,7 @@ public Object handleAPICallEvent(ProceedingJoinPoint joinPoint) throws Throwable
75
75
.requestUri (request .getURI ().getPath ())
76
76
.headers (headers )
77
77
.queryParams (request .getQueryParams ())
78
+ .ipAddress (ipAddress )
78
79
.build ();
79
80
event .populateDetails ();
80
81
applicationEventPublisher .publishEvent (event );
You can’t perform that action at this time.
0 commit comments