Add BlockHoundIntegration for spring-web

Closes gh-26712
This commit is contained in:
Rossen Stoyanchev
2021-03-22 21:18:48 +00:00
parent a931ff12f6
commit 41d5048280
3 changed files with 36 additions and 0 deletions

View File

@@ -23,6 +23,9 @@ import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import reactor.blockhound.BlockHound;
import reactor.blockhound.integration.BlockHoundIntegration;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
@@ -418,4 +421,20 @@ public final class WebHttpHandlerBuilder {
return new WebHttpHandlerBuilder(this);
}
/**
* {@code BlockHoundIntegration} for spring-web classes.
* @since 5.3.6
*/
public static class SpringWebBlockHoundIntegration implements BlockHoundIntegration {
@Override
public void applyTo(BlockHound.Builder builder) {
// Avoid hard references potentially anywhere in spring-web (no need for structural dependency)
builder.allowBlockingCallsInside("org.springframework.web.util.HtmlUtils", "<clinit>");
}
}
}