Skip to content

Commit

Permalink
Use clearer name for new middlware
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed Nov 26, 2023
1 parent 75ed5ef commit 1ae1b37
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
from api.utils.oauth2_helper import get_token_info


def client_application_middleware(get_response):
def response_headers_middleware(get_response):
"""
Add standard response headers used by Nginx logging.
These headers help Openverse more easily and directly connect
individual requests to each other. This is particularly useful
when evaluating traffic patterns from individual source IPs
to identify malicious requesters or request patterns.
"""

def middleware(request):
response = get_response(request)

Expand Down
2 changes: 1 addition & 1 deletion api/conf/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"api.middleware.client_application_middleware.client_application_middleware",
"api.middleware.response_headers_middleware.response_headers_middleware",
]

# Storage
Expand Down

0 comments on commit 1ae1b37

Please sign in to comment.