mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-01-13 07:05:11 +08:00
update 优化 编译警告问题 替换过期方法与类
This commit is contained in:
@@ -18,6 +18,7 @@ package com.alibaba.csp.sentinel.adapter.gateway.sc.callback;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.InvalidMediaTypeException;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.MimeTypeUtils;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Mono;
|
||||
@@ -67,7 +68,7 @@ public class DefaultBlockRequestHandler implements BlockRequestHandler {
|
||||
try {
|
||||
List<MediaType> acceptedMediaTypes = exchange.getRequest().getHeaders().getAccept();
|
||||
acceptedMediaTypes.remove(MediaType.ALL);
|
||||
MediaType.sortBySpecificityAndQuality(acceptedMediaTypes);
|
||||
MimeTypeUtils. sortBySpecificity(acceptedMediaTypes);
|
||||
return acceptedMediaTypes.stream()
|
||||
.anyMatch(MediaType.TEXT_HTML::isCompatibleWith);
|
||||
} catch (InvalidMediaTypeException ex) {
|
||||
|
||||
Reference in New Issue
Block a user