Spaces:
Running
Running
AuthorBot commited on
Commit ·
6d85d9d
1
Parent(s): ba2f394
Fix: CSP connect-src for jsdelivr + better create author error display
Browse files
app/middleware/security_headers.py
CHANGED
|
@@ -39,7 +39,7 @@ class SecurityHeadersMiddleware:
|
|
| 39 |
b"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; "
|
| 40 |
b"font-src 'self' https://fonts.gstatic.com; "
|
| 41 |
b"img-src 'self' data: https:; "
|
| 42 |
-
b"connect-src 'self' https://api.openai.com; "
|
| 43 |
b"frame-ancestors 'none'"),
|
| 44 |
]
|
| 45 |
if use_hsts:
|
|
|
|
| 39 |
b"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; "
|
| 40 |
b"font-src 'self' https://fonts.gstatic.com; "
|
| 41 |
b"img-src 'self' data: https:; "
|
| 42 |
+
b"connect-src 'self' https://api.openai.com https://cdn.jsdelivr.net; "
|
| 43 |
b"frame-ancestors 'none'"),
|
| 44 |
]
|
| 45 |
if use_hsts:
|
app/superadmin/templates/superadmin.html
CHANGED
|
@@ -682,7 +682,10 @@ async function executeCreateAuthor() {
|
|
| 682 |
toast(msg, 'success');
|
| 683 |
loadAuthors();
|
| 684 |
loadOverview();
|
| 685 |
-
} catch(e) {
|
|
|
|
|
|
|
|
|
|
| 686 |
}
|
| 687 |
|
| 688 |
/* SUBSCRIPTIONS — now powered by /super/grants */
|
|
|
|
| 682 |
toast(msg, 'success');
|
| 683 |
loadAuthors();
|
| 684 |
loadOverview();
|
| 685 |
+
} catch(e) {
|
| 686 |
+
console.error('Create author error:', e);
|
| 687 |
+
toast(e.message || 'Failed to create author', 'error');
|
| 688 |
+
}
|
| 689 |
}
|
| 690 |
|
| 691 |
/* SUBSCRIPTIONS — now powered by /super/grants */
|