Changeset c869272 in Klonkt for src


Ignore:
Timestamp:
06/14/2026 06:16:58 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
5e95aac
Parents:
8afbdd6
Message:

fix: allow inline event handlers (CSP) — avatar upload + role dropdown were not working

Helmet's default set script-src-attr to 'none', blocking ALL inline event
handlers. As a result, <input onchange="this.form.submit()"> on the avatar
upload (and the role <select>) did nothing: choosing a file did not fire a
submit. Now script-src-attr 'unsafe-inline', consistent with the already
permitted inline <script> (script-src 'unsafe-inline').

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/server.js

    r8afbdd6 rc869272  
    6666      defaultSrc: ["'self'"],
    6767      scriptSrc: ["'self'", "'unsafe-inline'"],
     68      // Helmet's default zet script-src-attr op 'none', wat ALLE inline event-
     69      // handlers (onchange/onclick/onsubmit) blokkeert — daardoor deed o.a. de
     70      // avatar-upload (<input onchange="this.form.submit()">) en de rol-dropdown
     71      // niets. We staan inline handlers expliciet toe, consistent met de al
     72      // toegestane inline <script> hierboven.
     73      scriptSrcAttr: ["'unsafe-inline'"],
    6874      styleSrc: ["'self'", "'unsafe-inline'"],
    6975      imgSrc: ["'self'", "data:", "https:"],
Note: See TracChangeset for help on using the changeset viewer.