Wapp

Check-in [cdac0cdb04]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the wapp-content-security-policy command so that it allows newline characters in the security policy input. These are removed before the security policy is added to the header.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cdac0cdb04c3ecf93e68c93512852d3ee7825b0bdf4ce105b10637d3ce26cc36
User & Date: drh 2024-05-19 22:08:45.972
Context
2024-05-19
22:12
Improvements to the url-shortener script. (check-in: cf3373ebee user: drh tags: trunk)
22:08
Fix the wapp-content-security-policy command so that it allows newline characters in the security policy input. These are removed before the security policy is added to the header. (check-in: cdac0cdb04 user: drh tags: trunk)
20:46
Updates and fixes to the url-shortener.tcl demo (check-in: e74cb059e3 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to wapp.tcl.
757
758
759
760
761
762
763


764
765
766
767
768
769
770
771
  }
  if {[dict exists $wapp .reply-extra]} {
    foreach {name value} [dict get $wapp .reply-extra] {
      puts $chan "$name: $value\r"
    }
  }
  if {[dict exists $wapp .csp]} {


    puts $chan "Content-Security-Policy: [dict get $wapp .csp]\r"
  }
  set mimetype [dict get $wapp .mimetype]
  puts $chan "Content-Type: $mimetype\r"
  if {[dict exists $wapp .new-cookies]} {
    foreach {nm val} [dict get $wapp .new-cookies] {
      if {[regexp {^[a-z][-a-z0-9_]*$} $nm]} {
        if {$val==""} {







>
>
|







757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
  }
  if {[dict exists $wapp .reply-extra]} {
    foreach {name value} [dict get $wapp .reply-extra] {
      puts $chan "$name: $value\r"
    }
  }
  if {[dict exists $wapp .csp]} {
    set csp [dict get $wapp .csp]
    regsub {\n} [string trim $csp] { } csp
    puts $chan "Content-Security-Policy: $csp\r"
  }
  set mimetype [dict get $wapp .mimetype]
  puts $chan "Content-Type: $mimetype\r"
  if {[dict exists $wapp .new-cookies]} {
    foreach {nm val} [dict get $wapp .new-cookies] {
      if {[regexp {^[a-z][-a-z0-9_]*$} $nm]} {
        if {$val==""} {