|
|
@ -29,7 +29,8 @@ import org.springframework.web.server.WebFilter;
|
|
|
|
import org.springframework.web.server.WebFilterChain;
|
|
|
|
import org.springframework.web.server.WebFilterChain;
|
|
|
|
|
|
|
|
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_RESOURCE_PREFIX;
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_RESOURCE_PREFIX;
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_UI_URL;
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_UI_V2_URL;
|
|
|
|
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_UI_V3_URL;
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_V2_API_DOC_URL;
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_V2_API_DOC_URL;
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_V3_API_DOC_URL;
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_V3_API_DOC_URL;
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_WEBJARS_V2_PREFIX;
|
|
|
|
import static com.tencent.cloud.polaris.contract.filter.FilterConstant.SWAGGER_WEBJARS_V2_PREFIX;
|
|
|
@ -52,9 +53,10 @@ public class ApiDocWebFluxFilter implements WebFilter {
|
|
|
|
public Mono<Void> filter(ServerWebExchange serverWebExchange, @NonNull WebFilterChain webFilterChain) {
|
|
|
|
public Mono<Void> filter(ServerWebExchange serverWebExchange, @NonNull WebFilterChain webFilterChain) {
|
|
|
|
if (!polarisContractProperties.isExposure()) {
|
|
|
|
if (!polarisContractProperties.isExposure()) {
|
|
|
|
String path = serverWebExchange.getRequest().getURI().getPath();
|
|
|
|
String path = serverWebExchange.getRequest().getURI().getPath();
|
|
|
|
if (path.equals(SWAGGER_V2_API_DOC_URL) ||
|
|
|
|
if (path.startsWith(SWAGGER_V2_API_DOC_URL) ||
|
|
|
|
path.startsWith(SWAGGER_V3_API_DOC_URL) ||
|
|
|
|
path.startsWith(SWAGGER_V3_API_DOC_URL) ||
|
|
|
|
path.equals(SWAGGER_UI_URL) ||
|
|
|
|
path.startsWith(SWAGGER_UI_V2_URL) ||
|
|
|
|
|
|
|
|
path.startsWith(SWAGGER_UI_V3_URL) ||
|
|
|
|
path.startsWith(SWAGGER_RESOURCE_PREFIX) ||
|
|
|
|
path.startsWith(SWAGGER_RESOURCE_PREFIX) ||
|
|
|
|
path.startsWith(SWAGGER_WEBJARS_V2_PREFIX) ||
|
|
|
|
path.startsWith(SWAGGER_WEBJARS_V2_PREFIX) ||
|
|
|
|
path.startsWith(SWAGGER_WEBJARS_V3_PREFIX)) {
|
|
|
|
path.startsWith(SWAGGER_WEBJARS_V3_PREFIX)) {
|
|
|
|