j49_c commited on
Commit
fe51cec
·
1 Parent(s): 69db2a0

Fix HF display: Remove X-Frame-Options restriction

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -70,9 +70,8 @@ def rate_limited(fn):
70
  def add_security_headers(response):
71
  response.headers['X-Content-Type-Options'] = 'nosniff'
72
  response.headers['X-XSS-Protection'] = '1; mode=block'
73
- response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains'
74
- response.headers['X-Frame-Options'] = 'SAMEORIGIN'
75
- response.headers['Referrer-Policy'] = 'strict-origin-when-cross-origin'
76
  return response
77
 
78
  ADMIN_USERNAME = os.environ.get("ADMIN_USER", "moh777")
 
70
  def add_security_headers(response):
71
  response.headers['X-Content-Type-Options'] = 'nosniff'
72
  response.headers['X-XSS-Protection'] = '1; mode=block'
73
+ # Removed X-Frame-Options for Hugging Face Spaces compatibility
74
+ response.headers['Referrer-Policy'] = 'no-referrer-when-downgrade'
 
75
  return response
76
 
77
  ADMIN_USERNAME = os.environ.get("ADMIN_USER", "moh777")