Formatting for 3.1.x

This commit is contained in:
spencergibb
2023-01-24 15:13:38 -05:00
parent 2d67158c20
commit 22536f2702
4 changed files with 10 additions and 7 deletions

View File

@@ -24,6 +24,7 @@ import org.springframework.web.server.ServerWebExchange;
* Contract to allow a {@link GatewayFilter} to delegate to the next in the chain.
*
* Copied from framework WebFilterChain
*
* @author Rossen Stoyanchev
* @since 5.0
*/

View File

@@ -21,13 +21,14 @@ import reactor.core.publisher.Mono;
import org.springframework.web.server.ServerWebExchange;
/**
* Contract for interception-style, chained processing of gateway requests that may be used to
* implement cross-cutting, application-agnostic requirements such as security, timeouts,
* and others.
* Contract for interception-style, chained processing of gateway requests that may be
* used to implement cross-cutting, application-agnostic requirements such as security,
* timeouts, and others.
*
* Only applies to matched gateway routes.
*
* Copied from framework WebFilter
*
* @author Rossen Stoyanchev
* @since 5.0
*/

View File

@@ -89,8 +89,8 @@ public class CacheRequestBodyGatewayFilterFactory
//
Object backupCachedBody = exchange.getAttributes()
.get(CACHED_ORIGINAL_REQUEST_BODY_BACKUP_ATTR);
if (backupCachedBody instanceof DataBuffer backupCachedDataBuffer) {
DataBufferUtils.release(backupCachedDataBuffer);
if (backupCachedBody instanceof DataBuffer) {
DataBufferUtils.release((DataBuffer) backupCachedBody);
}
});
}));

View File

@@ -174,8 +174,9 @@ public class CacheRequestBodyGatewayFilterFactoryTests extends BaseWebClientTest
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
return chain.filter(exchange).doAfterTerminate(() -> {
Object o = exchange.getAttributes()
.get(CacheRequestBodyGatewayFilterFactory.CACHED_ORIGIN_REQUEST_BODY_BACKUP_ATTR);
if (o instanceof PooledDataBuffer dataBuffer) {
.get(CacheRequestBodyGatewayFilterFactory.CACHED_ORIGINAL_REQUEST_BODY_BACKUP_ATTR);
if (o instanceof PooledDataBuffer) {
PooledDataBuffer dataBuffer = (PooledDataBuffer) o;
if (dataBuffer.isAllocated()) {
exchange.getResponse().setStatusCode(HttpStatus.INTERNAL_SERVER_ERROR);
fail("DataBuffer is not released");