Skip to content

Commit d8f32ad

Browse files
committed
Update comments
1 parent 1f78263 commit d8f32ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

django/thunderstore/api/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ def get(self, *args, **kwargs):
2828
class PublicCacheMixin:
2929
"""
3030
A mixin for caching public API endpoints.
31-
1. Caching: Automatically applies public cache headers.
32-
2. Security: Disables DRF authentication/permissions, preventing accidental use of request.user
31+
32+
1. Caching: Applies 'public' Cache-Control headers to the response.
33+
2. Security: Explicitly clears 'authentication_classes' and 'permission_classes'
34+
to override global DRF settings in settings.py. This ensures the endpoint is strictly
35+
anonymous and prevents 'request.user' from being populated, which
36+
mitigates the risk of caching user-specific data.
3337
"""
3438

3539
authentication_classes = []

0 commit comments

Comments
 (0)