Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixes #12828] New remote datasets are not registered inside proxy al… #282

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading