Skip to content

Commit

Permalink
fix: fix local image check for fallback urls
Browse files Browse the repository at this point in the history
  • Loading branch information
123FLO321 committed Jun 4, 2022
1 parent 47f1d73 commit 23e521d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftTileserverCache/Misc/ImageUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public class ImageUtils {
markerPath = "Markers/\(marker.url)"
}
if let fallbackUrl = marker.fallbackUrl, !FileManager.default.fileExists(atPath: markerPath) {
if fallbackUrl.starts(with: "http://") || marker.url.starts(with: "https://") {
if fallbackUrl.starts(with: "http://") || fallbackUrl.starts(with: "https://") {
let markerHashed = fallbackUrl.persistentHash
let markerFormat = fallbackUrl.components(separatedBy: ".").last ?? "png"
markerPath = "Cache/Marker/\(markerHashed).\(markerFormat)"
Expand Down

0 comments on commit 23e521d

Please sign in to comment.