Skip to content

Commit bc87dd8

Browse files
committed
Rename to newReturnValue()
1 parent b8a7ca3 commit bc87dd8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

agent/src/main/java/dev/aikido/agent/wrappers/spring/SpringWebfluxWrapper.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414
import org.springframework.core.io.buffer.DataBuffer;
1515
import org.springframework.core.io.buffer.DataBufferFactory;
1616
import org.springframework.http.HttpCookie;
17-
import org.springframework.http.HttpStatus;
1817
import org.springframework.http.server.reactive.ServerHttpRequest;
1918
import org.springframework.http.server.reactive.ServerHttpResponse;
2019
import reactor.core.publisher.Mono;
2120

2221
import java.lang.reflect.Executable;
23-
import java.lang.reflect.Method;
2422
import java.nio.charset.StandardCharsets;
2523
import java.util.*;
2624
import java.util.stream.Collectors;
@@ -54,7 +52,7 @@ public ElementMatcher<? super TypeDescription> getTypeMatcher() {
5452
return nameContainsIgnoreCase("org.springframework.web.server.adapter.HttpWebHandlerAdapter");
5553
}
5654

57-
public record SkipOnWrapper(Mono<Void> mono) {
55+
public record SkipOnWrapper(Mono<Void> newReturnValue) {
5856
}
5957

6058
public static class SpringWebfluxAdvice {
@@ -110,8 +108,8 @@ public static void onExit(
110108
// enterResult can be two things : Either the SkipOnWrapper or the ServerHttpResponse
111109
// ServerHttpResponse -> Extract status code.
112110
// SkipOnWrapper -> we blocked a request (e.g. IP Blocking), and are returning the value below
113-
if (enterResult instanceof SkipOnWrapper wrapper && wrapper.mono() != null) {
114-
returnValue = wrapper.mono();
111+
if (enterResult instanceof SkipOnWrapper wrapper && wrapper.newReturnValue() != null) {
112+
returnValue = wrapper.newReturnValue();
115113
} else if (enterResult instanceof ServerHttpResponse res) {
116114
// Report status code of response :
117115
Integer statusCode = res.getRawStatusCode();

0 commit comments

Comments
 (0)