|
|
@@ -67,9 +67,9 @@ public class RequestDecoderFilter extends AbstractGatewayFilterFactory<Object> {
|
|
|
return (exchange, chain) -> {
|
|
|
ServerHttpRequest request = exchange.getRequest();
|
|
|
|
|
|
- String contentType = Objects.requireNonNull(request.getHeaders().getContentType()).toString();
|
|
|
+ MediaType contentType = request.getHeaders().getContentType();
|
|
|
|
|
|
- if (FILE_TYPES.stream().anyMatch(contentType::startsWith)) {
|
|
|
+ if (contentType != null && FILE_TYPES.stream().anyMatch(contentType.toString()::startsWith)) {
|
|
|
// 这是一个文件请求
|
|
|
return chain.filter(exchange);
|
|
|
}
|