Star button throws CSP "unsafe-eval" error in browser console #59
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
Prio - Hoog
Prio - Laag
Prio - Middel
styling
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MinBZK/Codeplatform#59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Clicking the star button on a repository triggers a JavaScript console error and (depending on browser) the star action may not register properly.
Error message
Evaluating a string as JavaScript violates the following Content Security Policy directive because 'unsafe-eval' is not an allowed source of script: script-src 'self' 'unsafe-inline'".
(https://code.overheid.nl/assets/js/index.js?v=15.0.3~gitea-1.22.0 @ 12:66499)
Steps to reproduce*
Expected behavior
Starring a repo should work without triggering a CSP violation.
Actual behavior
The bundled
index.jsappears to calleval()or an equivalent (e.g.new Function()), which is blocked by the server's currentContent-Security-Policyheader since it does not includeunsafe-evalinscript-src.Environment
Possible cause
Likely a mismatch between the CSP header sent by the server/reverse proxy and what the frontend JS expects. Either the CSP needs
unsafe-evaladded, or the relevant frontend code should avoid usingeval/new Function.Same issue?
#26