From 6a66844c2721ce35c483f394967f4e2be6d5d477 Mon Sep 17 00:00:00 2001 From: Alessandro Cerioni <acerioni@grandlyon.com> Date: Tue, 9 Apr 2019 17:10:04 +0200 Subject: [PATCH] Fixing a regression, which prevented the detection of the KML and SOS services. --- utils/fix_links.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/utils/fix_links.py b/utils/fix_links.py index 27b5e38..6994776 100644 --- a/utils/fix_links.py +++ b/utils/fix_links.py @@ -126,8 +126,17 @@ def fix_links( links, credentials=None ): except Exception as e: logging.debug(e) + + # KML + if link['protocol'] == "application/vnd.google-earth.kml+xml": + fixed_links[k]['protocol'] = 'KML' + + # SOS + if '/sos/' in link['url'].lower(): + fixed_links[k]['protocol'] = 'SOS' + # ...otherwise, we make a guess on the basis of the information carried by the URL - known_formats = ['ecw', 'pdf', 'zip', 'kml', 'json', 'tif', 'tiff', 'csv'] # sos + known_formats = ['ecw', 'pdf', 'zip', 'json', 'tif', 'tiff', 'csv'] for known_format in known_formats: if link['url'].lower().endswith(known_format): -- GitLab