Skip to content
Closed
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
5 changes: 4 additions & 1 deletion src/sentry/lang/javascript/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,13 @@ def fetch_file(url, project=None, release=None, allow_scraping=True):
domain_result['url'] = url
raise CannotFetchSource(domain_result)

verify_tls = False

headers = {}
if project and is_valid_origin(url, project=project):
token = project.get_option('sentry:token')
if token:
verify_tls = True
headers['X-Sentry-Token'] = token

logger.debug('Fetching %r from the internet', url)
Expand All @@ -340,7 +343,7 @@ def fetch_file(url, project=None, release=None, allow_scraping=True):
response = http_session.get(
url,
allow_redirects=True,
verify=False,
verify=verify_tls,
headers=headers,
timeout=settings.SENTRY_SOURCE_FETCH_TIMEOUT,
)
Expand Down