fix: if no aggregate resource, should direct response client
This commit is contained in:
@@ -34,6 +34,7 @@ import org.springframework.core.io.buffer.DataBuffer;
|
|||||||
import org.springframework.core.io.buffer.DataBufferUtils;
|
import org.springframework.core.io.buffer.DataBufferUtils;
|
||||||
import org.springframework.core.io.buffer.NettyDataBufferFactory;
|
import org.springframework.core.io.buffer.NettyDataBufferFactory;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||||
import org.springframework.http.server.reactive.ServerHttpResponse;
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -93,7 +94,7 @@ public class FizzGatewayFilter implements WebFilter {
|
|||||||
String method = request.getMethodValue();
|
String method = request.getMethodValue();
|
||||||
AggregateResource aggregateResource = configLoader.matchAggregateResource(method, path);
|
AggregateResource aggregateResource = configLoader.matchAggregateResource(method, path);
|
||||||
if (aggregateResource == null) {
|
if (aggregateResource == null) {
|
||||||
return chain.filter(exchange);
|
return WebUtils.responseError(exchange, HttpStatus.INTERNAL_SERVER_ERROR.value(), "no aggregate resource: " + path);
|
||||||
}
|
}
|
||||||
|
|
||||||
Pipeline pipeline = aggregateResource.getPipeline();
|
Pipeline pipeline = aggregateResource.getPipeline();
|
||||||
|
|||||||
Reference in New Issue
Block a user