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

fix(spotlight): Use the spotlight_url passed into the SDK when loading Spotlight #3871

Merged
merged 4 commits into from
Dec 14, 2024
Merged
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
6 changes: 4 additions & 2 deletions sentry_sdk/spotlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def capture_envelope(self, envelope):

SPOTLIGHT_JS_ENTRY_PATH = "/assets/main.js"
SPOTLIGHT_JS_SNIPPET_PATTERN = (
'<script type="module" crossorigin src="{}"></script>'
"<script>window.__spotlight = {{ initOptions: {{ sidecarUrl: '{spotlight_url}', fullPage: false }} }};</script>\n"
'<script type="module" crossorigin src="{spotlight_js_url}"></script>\n'
)
SPOTLIGHT_ERROR_PAGE_SNIPPET = (
'<html><base href="{spotlight_url}">\n'
Expand Down Expand Up @@ -113,7 +114,8 @@ def spotlight_script(self):
)
urllib.request.urlopen(req)
self._spotlight_script = SPOTLIGHT_JS_SNIPPET_PATTERN.format(
spotlight_js_url
spotlight_url=self._spotlight_url,
spotlight_js_url=spotlight_js_url,
)
except urllib.error.URLError as err:
sentry_logger.debug(
Expand Down
Loading