Remove ServerWebExchange dependency in ServerRequestObservationContext
Avoiding cycle between http.server and web.server packages. See gh-30013
This commit is contained in:
@@ -174,7 +174,7 @@ public class RouterFunctionMapping extends AbstractHandlerMapping implements Ini
|
||||
org.springframework.web.filter.reactive.ServerHttpObservationFilter
|
||||
.findObservationContext(serverRequest.exchange())
|
||||
.ifPresent(context -> context.setPathPattern(matchingPattern.toString()));
|
||||
ServerRequestObservationContext.findCurrent(serverRequest.exchange())
|
||||
ServerRequestObservationContext.findCurrent(serverRequest.exchange().getAttributes())
|
||||
.ifPresent(context -> context.setPathPattern(matchingPattern.toString()));
|
||||
}
|
||||
Map<String, String> uriVariables =
|
||||
|
||||
@@ -170,7 +170,7 @@ public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping {
|
||||
org.springframework.web.filter.reactive.ServerHttpObservationFilter
|
||||
.findObservationContext(exchange)
|
||||
.ifPresent(context -> context.setPathPattern(pattern.toString()));
|
||||
ServerRequestObservationContext.findCurrent(exchange)
|
||||
ServerRequestObservationContext.findCurrent(exchange.getAttributes())
|
||||
.ifPresent(context -> context.setPathPattern(pattern.toString()));
|
||||
exchange.getAttributes().put(PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, pathWithinMapping);
|
||||
exchange.getAttributes().put(URI_TEMPLATE_VARIABLES_ATTRIBUTE, matchInfo.getUriVariables());
|
||||
|
||||
@@ -145,7 +145,7 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
|
||||
org.springframework.web.filter.reactive.ServerHttpObservationFilter
|
||||
.findObservationContext(exchange)
|
||||
.ifPresent(context -> context.setPathPattern(bestPattern.toString()));
|
||||
ServerRequestObservationContext.findCurrent(exchange)
|
||||
ServerRequestObservationContext.findCurrent(exchange.getAttributes())
|
||||
.ifPresent(context -> context.setPathPattern(bestPattern.toString()));
|
||||
exchange.getAttributes().put(URI_TEMPLATE_VARIABLES_ATTRIBUTE, uriVariables);
|
||||
exchange.getAttributes().put(MATRIX_VARIABLES_ATTRIBUTE, matrixVariables);
|
||||
|
||||
Reference in New Issue
Block a user