]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
importer: Ensure that we only use HTTPS URLs for Geofeeds
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 27 Sep 2022 08:05:11 +0000 (08:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 27 Sep 2022 16:47:17 +0000 (16:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/location-importer.in

index 0e2764e6d0a8bbea46dacb82cda4f9a058a7da40..d0384b5b6781ba27c8bd9ba2855abb661bc2811e 100644 (file)
@@ -894,6 +894,11 @@ class CLI(object):
                                # Update any geofeed information
                                geofeed = inetnum.get("geofeed", None)
 
+                               # Make sure that this is a HTTPS URL
+                               if geofeed and not geofeed.startswith("https://"):
+                                       log.warning("Geofeed URL is not using HTTPS: %s" % geofeed)
+                                       geofeed = None
+
                                # Store/update any geofeeds
                                if geofeed:
                                        self.db.execute("""