测试gitnore

This commit is contained in:
ladeng07
2022-05-06 15:45:57 +08:00
parent 12f390949b
commit 51552904f9
2347 changed files with 120102 additions and 53549 deletions
@@ -21,17 +21,16 @@ class XFrameOptionsMiddleware(MiddlewareMixin):
response from being loaded in a frame in any site, set X_FRAME_OPTIONS in
your project's Django settings to 'DENY'.
"""
def process_response(self, request, response):
# Don't set it if it's already in the response
if response.get("X-Frame-Options") is not None:
if response.get('X-Frame-Options') is not None:
return response
# Don't set it if they used @xframe_options_exempt
if getattr(response, "xframe_options_exempt", False):
if getattr(response, 'xframe_options_exempt', False):
return response
response.headers["X-Frame-Options"] = self.get_xframe_options_value(
response.headers['X-Frame-Options'] = self.get_xframe_options_value(
request,
response,
)
@@ -45,4 +44,4 @@ class XFrameOptionsMiddleware(MiddlewareMixin):
This method can be overridden if needed, allowing it to vary based on
the request or response.
"""
return getattr(settings, "X_FRAME_OPTIONS", "DENY").upper()
return getattr(settings, 'X_FRAME_OPTIONS', 'DENY').upper()