734
735
736
737
738
739
740
741
742
743
744
745
746
747
|
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
|
+
|
wapp-mimetype text/html
wapp-trim {
<h1>Wapp Application Error</h1>
<pre>%html($::errorInfo)</pre>
}
dict unset wapp .new-cookies
}
wapp-before-reply-hook
# Transmit the HTTP reply
#
if {$chan=="stdout"} {
puts $chan "Status: [dict get $wapp .reply-code]\r"
} else {
puts $chan "HTTP/1.1 [dict get $wapp .reply-code]\r"
|
790
791
792
793
794
795
796
797
798
799
800
801
802
803
|
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
|
+
+
+
+
+
+
+
+
+
|
}
# This routine runs just prior to request-handler dispatch. The
# default implementation is a no-op, but applications can override
# to do additional transformations or checks.
#
proc wapp-before-dispatch-hook {} {return}
# This routine runs after the request-handler dispatch and just
# before the reply is generated. The default implementation is
# a no-op, but applications can override to do validation and security
# checks on the reply, such as verifying that no sensitive information
# such as an API key or password is accidentally included in the
# reply text.
#
proc wapp-before-reply-hook {} {return}
# Process a single CGI request
#
proc wappInt-handle-cgi-request {} {
global wapp env
foreach key [array names env {[A-Z]*}] {dict set wapp $key $env($key)}
set len 0
|