Ignore:
Timestamp:
2023-10-04T15:57:40+02:00 (14 months ago)
Author:
taylor.smock
Message:

Fix an off-by-one error in HTTP Range requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pmtiles/src/main/java/org/openstreetmap/josm/plugins/pmtiles/lib/PMTiles.java

    r36112 r36156  
    1414import java.util.zip.InflaterInputStream;
    1515
    16 import jakarta.json.Json;
    17 import jakarta.json.JsonObject;
    1816import org.apache.commons.compress.compressors.brotli.BrotliCompressorInputStream;
    1917import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
     
    2119import org.openstreetmap.josm.plugins.pmtiles.lib.internal.HeaderParser;
    2220import org.openstreetmap.josm.tools.Utils;
     21
     22import jakarta.json.Json;
     23import jakarta.json.JsonObject;
    2324
    2425/**
     
    273274            }
    274275        }
    275         var request = HttpRequest.newBuilder(location).header("Range", "bytes=" + start + "-" + (start + length))
     276        var request = HttpRequest.newBuilder(location).header("Range", "bytes=" + start + "-" + (start + length - 1))
    276277                .header("User-Agent", "JOSM PMTiles v1").GET().build();
    277278        try {
Note: See TracChangeset for help on using the changeset viewer.