|
|
|
@ -31,7 +31,14 @@ public class RequestParamGlobalFilter implements GlobalFilter, Ordered { |
|
|
|
HttpHeaders headers = request.getHeaders(); |
|
|
|
MediaType contentType = headers.getContentType(); |
|
|
|
long contentLength = headers.getContentLength(); |
|
|
|
return contentLength <= 0L || !MediaType.APPLICATION_JSON.equals(contentType) && !MediaType.APPLICATION_JSON_UTF8.equals(contentType) ? chain.filter(exchange) : this.readBody(exchange, chain); |
|
|
|
final String uriPath = request.getURI().getPath(); |
|
|
|
return contentLength <= 0L |
|
|
|
|| !MediaType.APPLICATION_JSON.equals(contentType) && !MediaType.APPLICATION_JSON_UTF8.equals(contentType) |
|
|
|
|| uriPath.contains("/task/add") |
|
|
|
|| uriPath.contains("/task/save") |
|
|
|
? |
|
|
|
chain.filter(exchange) : |
|
|
|
this.readBody(exchange, chain); |
|
|
|
} |
|
|
|
|
|
|
|
private Mono<Void> readBody(ServerWebExchange exchange, GatewayFilterChain chain) { |
|
|
|
|