fix: not all responses have a length

This commit is contained in:
MiniDigger | Martin 2023-05-07 21:14:48 +02:00
parent 666bb5a4b5
commit 626368bb34

View File

@ -106,7 +106,8 @@ public class ImageProxyController {
private boolean contentTooLarge(final ClientResponse response) {
final var contentLength = response.headers().contentLength();
return contentLength.isEmpty() || contentLength.getAsLong() > 100_000_000;
// not all responses have a length...
return contentLength.isPresent() && contentLength.getAsLong() > 150_000_000;
}
private boolean validContentType(final ClientResponse response) {