Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ def register_temporary_features(manager: FeatureManager) -> None:
manager.add("organizations:profiling-beta", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=True)
# Enables dropping of profiles that may come from buggy sdks
manager.add("organizations:profiling-reject-sdks", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enables production profiling in sentry browser application
manager.add("organizations:profiling-browser", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=False)
# Enables separate differential flamegraph page
manager.add("organizations:profiling-differential-flamegraph-page", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable global suspect functions in profiling
Expand Down
10 changes: 1 addition & 9 deletions src/sentry/web/frontend/react_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import logging
from fnmatch import fnmatch

import sentry_sdk
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.http import Http404, HttpRequest, HttpResponse, HttpResponseRedirect
Expand Down Expand Up @@ -172,14 +171,7 @@ def handle_react(

response = render_to_response("sentry/base-react.html", context=context, request=request)

try:
if "x-sentry-browser-profiling" in request.headers or (
organization is not None
and features.has("organizations:profiling-browser", organization)
):
response["Document-Policy"] = "js-profiling"
except Exception as error:
sentry_sdk.capture_exception(error)
response["Document-Policy"] = "js-profiling"

return response

Expand Down
18 changes: 2 additions & 16 deletions tests/sentry/web/frontend/test_react_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,21 +401,7 @@ def test_customer_domain_org_deletion_in_progress(self) -> None:
]
assert "activeorg" in self.client.session

def test_document_policy_header_when_flag_is_enabled(self) -> None:
org = self.create_organization(owner=self.user)

self.login_as(self.user)

with self.feature({"organizations:profiling-browser": [org.slug]}):
response = self.client.get(
"/issues/",
HTTP_HOST=f"{org.slug}.testserver",
follow=True,
)
assert response.status_code == 200
assert response.headers["Document-Policy"] == "js-profiling"

def test_document_policy_header_when_flag_is_disabled(self) -> None:
def test_document_policy_header(self) -> None:
org = self.create_organization(owner=self.user)

self.login_as(self.user)
Expand All @@ -426,7 +412,7 @@ def test_document_policy_header_when_flag_is_disabled(self) -> None:
follow=True,
)
assert response.status_code == 200
assert "Document-Policy" not in response.headers
assert response.headers["Document-Policy"] == "js-profiling"

def test_dns_prefetch(self) -> None:
us_region = Cell("us", 1, "https://us.testserver", RegionCategory.MULTI_TENANT)
Expand Down
Loading