Changeset 19653 in josm


Ignore:
Timestamp:
2026-10-22T17:03:00+02:00 (3 hours ago)
Author:
stoecker
Message:

fix #24730 - accept application/octet-stream as mime type for images (support ugly server configurations)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java

    r19307 r19653  
    152152    private boolean isNotImage(Map<String, List<String>> headers, int statusCode) {
    153153        if (statusCode == 200 && headers.containsKey("Content-Type") && !headers.get("Content-Type").isEmpty()) {
    154             String contentType = headers.get("Content-Type").stream().findAny().orElse(null);
    155             if (contentType != null && !contentType.startsWith("image") && !MVTFile.MIMETYPE.contains(contentType.toLowerCase(Locale.ROOT))) {
     154            String contentType = headers.get("Content-Type").stream().findAny().orElse("").toLowerCase(Locale.ROOT);
     155            if (!contentType.startsWith("image")
     156                && !contentType.startsWith("application/octet-stream")
     157                && !MVTFile.MIMETYPE.contains(contentType)) {
    156158                Logging.warn("Image not returned for tile: " + url + " content type was: " + contentType);
    157159                // not an image - do not store response in cache, so next time it will be queried again from the server
Note: See TracChangeset for help on using the changeset viewer.