Wapp

Changes On Branch duplicate-parameters
Login

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

Changes In Branch duplicate-parameters Excluding Merge-Ins

This is equivalent to a diff from 44975d66a9 to e431ca0d00

2024-11-22
16:04
Improved error message when unauthorized characters are used in the request URI. (Leaf check-in: 3b1ce7c023 user: drh tags: trunk)
2024-11-18
14:47
If there are duplicate query parameters, the value becomes a list that is formed from teh values of the duplicates. Forum post 5eb29da65a. (Leaf check-in: e431ca0d00 user: drh tags: duplicate-parameters)
2024-11-09
12:41
Fix to the "clean" target on the MacOS makefile (check-in: 44975d66a9 user: drh tags: trunk)
12:34
Add a makefile for windows. Improvements, including better comments, in existing makefiles. (check-in: b7abbe4090 user: drh tags: trunk)

Changes to wapp.tcl.
571
572
573
574
575
576
577
578





579
580
581
582
583
584
585
586
587
588
589





590
591
592
593
594
595
596
  global wapp
  dict set wapp .qp 1
  if {[dict exists $wapp QUERY_STRING]} {
    foreach qterm [split [dict get $wapp QUERY_STRING] &] {
      set qsplit [split $qterm =]
      set nm [lindex $qsplit 0]
      if {[regexp {^[a-z][a-z0-9]*$} $nm]} {
        dict set wapp $nm [wappInt-decode-url [lindex $qsplit 1]]





      }
    }
  }
  if {[dict exists $wapp CONTENT_TYPE] && [dict exists $wapp CONTENT]} {
    set ctype [dict get $wapp CONTENT_TYPE]
    if {$ctype=="application/x-www-form-urlencoded"} {
      foreach qterm [split [string trim [dict get $wapp CONTENT]] &] {
        set qsplit [split $qterm =]
        set nm [lindex $qsplit 0]
        if {[regexp {^[a-z][-a-z0-9_]*$} $nm]} {
          dict set wapp $nm [wappInt-decode-url [lindex $qsplit 1]]





        }
      }
    } elseif {[string match multipart/form-data* $ctype]} {
      regexp {^(.*?)\n(.*)$} [dict get $wapp CONTENT] all divider body
      set ndiv [string length $divider]
      while {[string length $body]} {
        set idx [string first $divider $body]







|
>
>
>
>
>










|
>
>
>
>
>







571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
  global wapp
  dict set wapp .qp 1
  if {[dict exists $wapp QUERY_STRING]} {
    foreach qterm [split [dict get $wapp QUERY_STRING] &] {
      set qsplit [split $qterm =]
      set nm [lindex $qsplit 0]
      if {[regexp {^[a-z][a-z0-9]*$} $nm]} {
        set p [wappInt-decode-url [lindex $qsplit 1]]
        if {[dict exists $wapp $nm]} {
          dict lappend wapp $nm $p
        } else {
          dict set wapp $nm $p
        }
      }
    }
  }
  if {[dict exists $wapp CONTENT_TYPE] && [dict exists $wapp CONTENT]} {
    set ctype [dict get $wapp CONTENT_TYPE]
    if {$ctype=="application/x-www-form-urlencoded"} {
      foreach qterm [split [string trim [dict get $wapp CONTENT]] &] {
        set qsplit [split $qterm =]
        set nm [lindex $qsplit 0]
        if {[regexp {^[a-z][-a-z0-9_]*$} $nm]} {
          set p [wappInt-decode-url [lindex $qsplit 1]]
          if {[dict exists $wapp $nm]} {
            dict lappend wapp $nm $p
          } else {
            dict set wapp $nm $p
          }
        }
      }
    } elseif {[string match multipart/form-data* $ctype]} {
      regexp {^(.*?)\n(.*)$} [dict get $wapp CONTENT] all divider body
      set ndiv [string length $divider]
      while {[string length $body]} {
        set idx [string first $divider $body]