This commit is contained in:
Spencer Gibb
2017-06-26 12:32:19 -06:00
parent 27e5e178d9
commit bc635b9587
2 changed files with 10 additions and 9 deletions

View File

@@ -24,10 +24,8 @@ import java.util.stream.Collectors;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cloud.gateway.filter.OrderedWebFilter;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.config.GatewayProperties;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.cloud.gateway.filter.OrderedWebFilter;
import org.springframework.cloud.gateway.filter.factory.WebFilterFactory;
import org.springframework.cloud.gateway.route.Route;
import org.springframework.core.Ordered;

View File

@@ -29,13 +29,16 @@ public class ServerWebExchangeUtils {
private static final Log logger = LogFactory.getLog(ServerWebExchangeUtils.class);
public static final String URI_TEMPLATE_VARIABLES_ATTRIBUTE =
ServerWebExchangeUtils.class.getName() + ".uriTemplateVariables";
public static final String URI_TEMPLATE_VARIABLES_ATTRIBUTE = qualify("uriTemplateVariables");
public static final String CLIENT_RESPONSE_ATTR = "webHandlerClientResponse";
public static final String GATEWAY_ROUTE_ATTR = "gatewayRoute";
public static final String GATEWAY_REQUEST_URL_ATTR = "gatewayRequestUrl";
public static final String GATEWAY_HANDLER_MAPPER_ATTR = "gatewayHandlerMapper";
public static final String CLIENT_RESPONSE_ATTR = qualify("webHandlerClientResponse");
public static final String GATEWAY_ROUTE_ATTR = qualify("gatewayRoute");
public static final String GATEWAY_REQUEST_URL_ATTR = qualify("gatewayRequestUrl");
public static final String GATEWAY_HANDLER_MAPPER_ATTR = qualify("gatewayHandlerMapper");
private static String qualify(String attr) {
return ServerWebExchangeUtils.class.getName() + "." + attr;
}
public static boolean setResponseStatus(ServerWebExchange exchange, HttpStatus httpStatus) {
boolean response = exchange.getResponse().setStatusCode(httpStatus);