Skip to content

Commit

Permalink
fix(ui) Fix domains in prefetch-dns tags (#79841)
Browse files Browse the repository at this point in the history
I forgot that `region.address` is not a public DNS name.

Refs #79784
  • Loading branch information
markstory authored Oct 28, 2024
1 parent e8159b8 commit c6891fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/sentry/web/frontend/react_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from rest_framework.request import Request

from sentry import features, options
from sentry.api.utils import generate_region_url
from sentry.organizations.absolute_url import customer_domain_path, generate_organization_url
from sentry.organizations.services.organization import organization_service
from sentry.types.region import (
Expand Down Expand Up @@ -75,7 +76,7 @@ def dns_prefetch(self) -> list[str]:
return domains
for region_name in regions:
region = get_region_by_name(region_name)
domains.append(region.address)
domains.append(generate_region_url(region.name))
return domains

def handle_react(self, request: Request, **kwargs) -> HttpResponse:
Expand Down
2 changes: 1 addition & 1 deletion tests/sentry/web/frontend/test_react_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,6 @@ def test_dns_prefetch(self):
response = self.client.get("/issues/", HTTP_HOST=f"{org.slug}.testserver")
assert response.status_code == 200
response_body = response.content
assert '<link rel="dns-prefetch" href="https://us.testserver"' in response_body.decode(
assert '<link rel="dns-prefetch" href="http://us.testserver"' in response_body.decode(
"utf-8"
)

0 comments on commit c6891fe

Please sign in to comment.