[09/10] importer: Ensure that we only use HTTPS URLs for Geofeeds

Message ID 20220927164847.3409646-9-michael.tremer@ipfire.org
State Accepted
Commit d96702a294ef4c7ebad6564d21e44091eeb5f005
Headers
Series [01/10] importer: Store geofeed URLs from RIR data |

Commit Message

Michael Tremer Sept. 27, 2022, 4:48 p.m. UTC
  Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 src/scripts/location-importer.in | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in
index 0e2764e..d0384b5 100644
--- a/src/scripts/location-importer.in
+++ b/src/scripts/location-importer.in
@@ -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("""