Wapp

Check-in [3b1ce7c023]
Login

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

Overview
Comment:Improved error message when unauthorized characters are used in the request URI.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3b1ce7c0234b4b2750deadc80f524ed28e835aa5e741bf3fe63b416a16a55699
User & Date: drh 2024-11-22 16:04:42.160
Context
2024-12-31
20:34
Update the built-in SQLite to the latest 3.48.0 beta for testing. (check-in: cf707bae76 user: drh tags: trunk)
2024-11-22
16:04
Improved error message when unauthorized characters are used in the request URI. (check-in: 3b1ce7c023 user: drh tags: trunk)
2024-11-09
12:41
Fix to the "clean" target on the MacOS makefile (check-in: 44975d66a9 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to wapp.tcl.
530
531
532
533
534
535
536

537
538
539
540
541
542
543
544
    error "unsupported request method: \"[dict get $W REQUEST_METHOD]\""
  }
  set uri [lindex $req 1]
  dict set W REQUEST_URI $uri
  set split_uri [split $uri ?]
  set uri0 [lindex $split_uri 0]
  if {![regexp {^/[-.a-z0-9_/]*$} $uri0]} {

    error "invalid request uri: \"$uri0\""
  }
  dict set W PATH_INFO $uri0
  set uri1 [lindex $split_uri 1]
  dict set W QUERY_STRING $uri1
  set n [llength $hdr]
  for {set i 1} {$i<$n} {incr i} {
    set x [lindex $hdr $i]







>
|







530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
    error "unsupported request method: \"[dict get $W REQUEST_METHOD]\""
  }
  set uri [lindex $req 1]
  dict set W REQUEST_URI $uri
  set split_uri [split $uri ?]
  set uri0 [lindex $split_uri 0]
  if {![regexp {^/[-.a-z0-9_/]*$} $uri0]} {
    regsub -all {[-.a-z0-9_/]+} $uri0 {} bad
    error "disallowed character(s) \"$bad\" in request uri: \"$uri0\""
  }
  dict set W PATH_INFO $uri0
  set uri1 [lindex $split_uri 1]
  dict set W QUERY_STRING $uri1
  set n [llength $hdr]
  for {set i 1} {$i<$n} {incr i} {
    set x [lindex $hdr $i]