Skip to content

Commit 36f833e

Browse files
committed
include auth header if url is internal
1 parent a8ca47f commit 36f833e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ckanext/archiver/tasks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ def download(context, resource, url_timeout=30,
394394

395395
if len(get_sysadmins()) > 0:
396396
sysadmin = get_sysadmins()[0]
397-
headers['Authorization'] = sysadmin.apikey
397+
if url.startswith(config.get('ckan.site_url', '')):
398+
headers['Authorization'] = sysadmin.apikey
398399

399400
# start the download - just get the headers
400401
# May raise DownloadException

0 commit comments

Comments
 (0)