Do not add Accept-Ranges header on client-side

This commit fixes a regression that added the Accept-Ranges header on
both client and server. Accept-Ranges is response header, so we now make
sure it only appears on the server side.

See gh-28291
This commit is contained in:
Arjen Poutsma
2022-04-12 10:36:49 +02:00
parent 3c37fa2edf
commit 5fc8a9839c
2 changed files with 23 additions and 2 deletions

View File

@@ -145,7 +145,10 @@ public class ResourceHttpMessageWriter implements HttpMessageWriter<Resource> {
headers.setContentLength(length);
}
}
headers.set(HttpHeaders.ACCEPT_RANGES, "bytes");
if (message instanceof ServerHttpResponse) {
// server side
headers.set(HttpHeaders.ACCEPT_RANGES, "bytes");
}
}
private static MediaType getResourceMediaType(