Skip to content
Snippets Groups Projects
Commit 6a66844c authored by Alessandro Cerioni's avatar Alessandro Cerioni
Browse files

Fixing a regression, which prevented the detection of the KML and SOS services.

parent a1ce5aa9
Branches
Tags
No related merge requests found
...@@ -126,8 +126,17 @@ def fix_links( links, credentials=None ): ...@@ -126,8 +126,17 @@ def fix_links( links, credentials=None ):
except Exception as e: except Exception as e:
logging.debug(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 # ...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: for known_format in known_formats:
if link['url'].lower().endswith(known_format): if link['url'].lower().endswith(known_format):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment