This commit is contained in:
caohong 2021-02-24 08:11:18 +08:00
commit 121568dbe4
1 changed files with 2 additions and 1 deletions

View File

@ -28,8 +28,9 @@ public class BlackListUrlFilter extends AbstractGatewayFilterFactory<BlackListUr
if (config.matchBlacklist(url))
{
ServerHttpResponse response = exchange.getResponse();
response.getHeaders().add("Content-Type", "application/json;charset=UTF-8");
return exchange.getResponse().writeWith(
Mono.just(response.bufferFactory().wrap(JSON.toJSONBytes(AjaxResult.error("服务拒绝访问")))));
Mono.just(response.bufferFactory().wrap(JSON.toJSONBytes(AjaxResult.error("请求地址不允许访问")))));
}
return chain.filter(exchange);