Skip to content

Commit 0fbf5bf

Browse files
ref(falcon): Drop send_default_pii support (#7695)
### Description - `PyramidRequestExtractor` inherits from `RequestExtractor` which still has some `send_default_pii` branching, but this will be fixed in #7616; same for `SentryWsgiMiddleware`. #### Issues Resolves #7650
1 parent 41bc733 commit 0fbf5bf

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

‎tests/integrations/falcon/test_falcon.py‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def test_has_context(
6868
):
6969
sentry_init(
7070
integrations=[FalconIntegration()],
71+
data_collection={},
7172
)
7273

7374
client = make_client()
@@ -280,6 +281,7 @@ def test_falcon_large_json_request(
280281
integrations=[FalconIntegration()],
281282
max_request_body_size="always",
282283
max_value_length=max_value_length,
284+
data_collection={},
283285
)
284286

285287
data = {"foo": {"bar": "a" * (1034)}}
@@ -314,13 +316,23 @@ def on_post(self, req, resp):
314316

315317

316318
@pytest.mark.parametrize("data", [{}, []], ids=["empty-dict", "empty-list"])
319+
@pytest.mark.parametrize(
320+
"data_collection, expect_body",
321+
[
322+
pytest.param({}, True, id="default-http-bodies"),
323+
pytest.param({"http_bodies": []}, False, id="no-http-bodies"),
324+
],
325+
)
317326
def test_falcon_empty_json_request(
318327
sentry_init,
319328
capture_items,
320329
data,
330+
data_collection,
331+
expect_body,
321332
):
322333
sentry_init(
323334
integrations=[FalconIntegration()],
335+
data_collection=data_collection,
324336
)
325337

326338
class Resource:
@@ -340,7 +352,10 @@ def on_post(self, req, resp):
340352
assert response.status == falcon.HTTP_200
341353

342354
(event,) = (item.payload for item in items)
343-
assert event["request"]["data"] == data
355+
if expect_body:
356+
assert event["request"]["data"] == data
357+
else:
358+
assert "data" not in event["request"]
344359

345360

346361
def test_falcon_raw_data_request(
@@ -349,6 +364,7 @@ def test_falcon_raw_data_request(
349364
):
350365
sentry_init(
351366
integrations=[FalconIntegration()],
367+
data_collection={},
352368
)
353369

354370
class Resource:
@@ -613,6 +629,7 @@ def on_post(self, req, _):
613629

614630
sentry_init(
615631
integrations=[FalconIntegration()],
632+
data_collection={},
616633
)
617634

618635
try:

0 commit comments

Comments
 (0)