-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Closed
Copy link
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
When sending a request to a resource with an invalid range, the server responds with a 500 Internal server error instead of 416 Requested range not satisfiable.
When the ResourceHttpRequestHandler
is executed with an invalid range then it will call the HttpServletResponse.sendError(HttpServletResponse.SC_REQUESTED_RANGE_NOT_SATISFIABLE)
method:
Lines 578 to 581 in 75329e6
catch (IllegalArgumentException ex) { | |
response.setHeader(HttpHeaders.CONTENT_RANGE, "bytes */" + resource.contentLength()); | |
response.sendError(HttpServletResponse.SC_REQUESTED_RANGE_NOT_SATISFIABLE); | |
} |
ProblemDetail
body response, so the writeWithMessageConverters
method in AbstractMessageConverterMethodProcessor
will throw a HttpMessageNotWritableException
from: Lines 364 to 367 in 8b14bf8
if (isContentTypePreset || !CollectionUtils.isEmpty(producibleMediaTypes)) { | |
throw new HttpMessageNotWritableException( | |
"No converter for [" + valueType + "] with preset Content-Type '" + contentType + "'"); | |
} |
valueType
is java.util.LinkedHashMap
and contentType
is multipart/form-data
)Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug