diff --git a/core/tasks.py b/core/tasks.py index 5452e01..0686c7e 100644 --- a/core/tasks.py +++ b/core/tasks.py @@ -293,7 +293,7 @@ def download_data_source(object_id, model=None, lang_code="en"): datasource.files.add(*files) else: - r = requests.get(datasource.urls[0], stream=True) # noqa: S113 + r = requests.get(datasource.urls[0], stream=True, timeout=10) if r.status_code != 200: logger.error( "Error while downloading data file for %s", @@ -355,7 +355,7 @@ def download_data_source(object_id, model=None, lang_code="en"): datasource.analyzed_file.name = path datasource.save() else: - r = requests.get(datasource.analyzed_data_url, stream=True) # noqa: S113 + r = requests.get(datasource.analyzed_data_url, stream=True, timeout=10) if r.status_code != 200: logger.error( "Error while downloading data file for %s", diff --git a/spoonbill_web/settings.py b/spoonbill_web/settings.py index 4717aa9..03cffba 100644 --- a/spoonbill_web/settings.py +++ b/spoonbill_web/settings.py @@ -38,7 +38,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = not production -ALLOWED_HOSTS = [".localhost", "127.0.0.1", "[::1]", "0.0.0.0"] # noqa: S104 +ALLOWED_HOSTS = [".localhost", "127.0.0.1", "[::1]", "0.0.0.0"] # noqa: S104 # Docker if "ALLOWED_HOSTS" in os.environ: ALLOWED_HOSTS.extend(os.getenv("ALLOWED_HOSTS").split(","))