Skip to content

Commit 7f0a467

Browse files
dcramermattrobenolt
authored andcommitted
Handle non-urls with release backed events (fixes GH-2647)
1 parent 3fc7899 commit 7f0a467

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/sentry/lang/javascript/processor.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,6 @@ def fetch_file(url, project=None, release=None, allow_scraping=True):
241241
"""
242242
if release:
243243
result = fetch_release_file(url, release)
244-
elif not allow_scraping or not url.startswith(('http:', 'https:')):
245-
error = {
246-
'type': EventError.JS_MISSING_SOURCE,
247-
'url': url,
248-
}
249-
raise CannotFetchSource(error)
250244
else:
251245
result = None
252246

@@ -255,6 +249,13 @@ def fetch_file(url, project=None, release=None, allow_scraping=True):
255249
)
256250

257251
if result is None:
252+
if not allow_scraping or not url.startswith(('http:', 'https:')):
253+
error = {
254+
'type': EventError.JS_MISSING_SOURCE,
255+
'url': url,
256+
}
257+
raise CannotFetchSource(error)
258+
258259
logger.debug('Checking cache for url %r', url)
259260
result = cache.get(cache_key)
260261
if result is not None:

0 commit comments

Comments
 (0)