diff --git a/tds/src/integrationTests/java/thredds/server/fileserver/TestPartialContent.java b/tds/src/integrationTests/java/thredds/server/fileserver/TestPartialContent.java index 8608d7761c..c22383d2b9 100644 --- a/tds/src/integrationTests/java/thredds/server/fileserver/TestPartialContent.java +++ b/tds/src/integrationTests/java/thredds/server/fileserver/TestPartialContent.java @@ -56,7 +56,7 @@ private void checkPartialContent(String path, long maxSize, String contentType) new int[] {HttpServletResponse.SC_PARTIAL_CONTENT}, contentType, byteRange); assertThat(content).isNotNull(); - final long expectedLength = Math.min(byteRange[1] - byteRange[0] + 1, maxSize); + final long expectedLength = Math.min(byteRange[1] - byteRange[0] + 1, maxSize - byteRange[0]); assertThat(content.length).isEqualTo(expectedLength); } }