Merge branch '2.3.x' into 2.4.x
Closes gh-25786
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -254,7 +254,7 @@ public class DefaultErrorWebExceptionHandler extends AbstractErrorWebExceptionHa
|
||||
return (serverRequest) -> {
|
||||
try {
|
||||
List<MediaType> acceptedMediaTypes = serverRequest.headers().accept();
|
||||
acceptedMediaTypes.remove(MediaType.ALL);
|
||||
acceptedMediaTypes.removeIf(MediaType.ALL::equalsTypeAndSubtype);
|
||||
MediaType.sortBySpecificityAndQuality(acceptedMediaTypes);
|
||||
return acceptedMediaTypes.stream().anyMatch(MediaType.TEXT_HTML::isCompatibleWith);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user