Skip to content

Commit

Permalink
[Fixes #12828] New remote datasets are not registered inside proxy al…
Browse files Browse the repository at this point in the history
…lowed hosts when GeoNode runs asynchoronously
  • Loading branch information
mattiagiupponi committed Jan 27, 2025
1 parent f9e7a74 commit b083db2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion importer/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
#########################################################################
import logging
from urllib.parse import urljoin
from urllib.parse import urljoin, urlsplit
from django.conf import settings
from django.urls import reverse
from pathlib import Path
Expand Down Expand Up @@ -48,6 +48,7 @@
from rest_framework.response import Response
from geonode.assets.handlers import asset_handler_registry
from geonode.assets.local import LocalAssetHandler
from geonode.proxy.utils import proxy_urls_registry

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -145,6 +146,10 @@ def create(self, request, *args, **kwargs):

action = ExecutionRequestAction.IMPORT.value

if "url" in extracted_params:
# we should register the hosts for the proxy
proxy_urls_registry.register_host(urlsplit(extracted_params["url"]).hostname)

input_params = {
**{"files": files, "handler_module_path": str(handler)},
**extracted_params,
Expand Down

0 comments on commit b083db2

Please sign in to comment.