Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrx committed Mar 12, 2024
1 parent 58dcc50 commit 0bc51a4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ public void handle(final HttpExchange exchange) throws IOException {
throw new AssertionError("Range header does not match expected format: " + range);
}

final int start = Integer.parseInt(matcher.group(1));
final int end = Integer.parseInt(matcher.group(2));
var responseBlob = blob.slice(start, Math.min(end - start + 1, blob.length() - start));
final long start = Long.parseLong(matcher.group(1));
final long end = Long.parseLong(matcher.group(2));
var responseBlob = blob.slice(Math.toIntExact(start), Math.toIntExact(Math.min(end - start + 1, blob.length() - start)));

exchange.getResponseHeaders().add("Content-Type", "application/octet-stream");
exchange.getResponseHeaders().add("x-ms-blob-content-length", String.valueOf(responseBlob.length()));
Expand Down

0 comments on commit 0bc51a4

Please sign in to comment.