Spaces:
Sleeping
Sleeping
GOOD CAT commited on
Commit ·
5e6267a
1
Parent(s): f47bef2
Allow Hugging Face Space embedding
Browse files- election_assistant/web.py +1 -2
- tests/test_python_app.py +5 -2
election_assistant/web.py
CHANGED
|
@@ -73,7 +73,6 @@ LOCALE_COUNTRY_HINTS = {
|
|
| 73 |
SECURITY_HEADERS = [
|
| 74 |
("Referrer-Policy", "no-referrer"),
|
| 75 |
("X-Content-Type-Options", "nosniff"),
|
| 76 |
-
("X-Frame-Options", "DENY"),
|
| 77 |
("Permissions-Policy", "geolocation=(), microphone=(), camera=()"),
|
| 78 |
(
|
| 79 |
"Content-Security-Policy",
|
|
@@ -86,7 +85,7 @@ SECURITY_HEADERS = [
|
|
| 86 |
"object-src 'none'; "
|
| 87 |
"base-uri 'self'; "
|
| 88 |
"form-action 'self'; "
|
| 89 |
-
"frame-ancestors '
|
| 90 |
),
|
| 91 |
]
|
| 92 |
|
|
|
|
| 73 |
SECURITY_HEADERS = [
|
| 74 |
("Referrer-Policy", "no-referrer"),
|
| 75 |
("X-Content-Type-Options", "nosniff"),
|
|
|
|
| 76 |
("Permissions-Policy", "geolocation=(), microphone=(), camera=()"),
|
| 77 |
(
|
| 78 |
"Content-Security-Policy",
|
|
|
|
| 85 |
"object-src 'none'; "
|
| 86 |
"base-uri 'self'; "
|
| 87 |
"form-action 'self'; "
|
| 88 |
+
"frame-ancestors 'self' https://huggingface.co https://*.huggingface.co",
|
| 89 |
),
|
| 90 |
]
|
| 91 |
|
tests/test_python_app.py
CHANGED
|
@@ -358,8 +358,11 @@ class PythonAppSmokeTests(unittest.TestCase):
|
|
| 358 |
header_map = dict(status_headers["headers"])
|
| 359 |
self.assertEqual(header_map["X-Content-Type-Options"], "nosniff")
|
| 360 |
self.assertEqual(header_map["Referrer-Policy"], "no-referrer")
|
| 361 |
-
self.
|
| 362 |
-
self.assertIn(
|
|
|
|
|
|
|
|
|
|
| 363 |
self.assertIn("HttpOnly", cookie)
|
| 364 |
self.assertIn("SameSite=Lax", cookie)
|
| 365 |
|
|
|
|
| 358 |
header_map = dict(status_headers["headers"])
|
| 359 |
self.assertEqual(header_map["X-Content-Type-Options"], "nosniff")
|
| 360 |
self.assertEqual(header_map["Referrer-Policy"], "no-referrer")
|
| 361 |
+
self.assertNotIn("X-Frame-Options", header_map)
|
| 362 |
+
self.assertIn(
|
| 363 |
+
"frame-ancestors 'self' https://huggingface.co https://*.huggingface.co",
|
| 364 |
+
header_map["Content-Security-Policy"],
|
| 365 |
+
)
|
| 366 |
self.assertIn("HttpOnly", cookie)
|
| 367 |
self.assertIn("SameSite=Lax", cookie)
|
| 368 |
|