Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Do not try to translate binary HTTP replies into UTF-8 as is done for text replies. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
c2a8732d7f9d30ff48caacc93fc8bfae |
User & Date: | drh 2018-01-08 23:02:38.179 |
Context
2018-01-08
| ||
23:19 | Do not throw errors when the HTTP client closes the connections without sending a request. (check-in: 0c4fbdfef0 user: drh tags: trunk) | |
23:02 | Do not try to translate binary HTTP replies into UTF-8 as is done for text replies. (check-in: c2a8732d7f user: drh tags: trunk) | |
2018-01-02
| ||
13:32 | Updates to the README file. (check-in: 1b2d69541a user: drh tags: trunk) | |
Changes
Changes to wapp.tcl.
︙ | ︙ | |||
371 372 373 374 375 376 377 378 | # # This routine is always running inside of a [catch], so if # any problems arise, simply raise an error. # proc wappInt-parse-header {chan} { upvar #0 wappInt-$chan W set hdr [split [dict get $W .header] \n] set req [lindex $hdr 0] | > > > > | | | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | # # This routine is always running inside of a [catch], so if # any problems arise, simply raise an error. # proc wappInt-parse-header {chan} { upvar #0 wappInt-$chan W set hdr [split [dict get $W .header] \n] if {$hdr==""} { wappInt-close-channel $chan return } set req [lindex $hdr 0] dict set W REQUEST_METHOD [set method [lindex $req 0]] if {[lsearch {GET HEAD POST} $method]<0} { error "unsupported request method: \"[dict get $W REQUEST_METHOD]\"" } set uri [lindex $req 1] set split_uri [split $uri ?] set uri0 [lindex $split_uri 0] if {![regexp {^/[-.a-z0-9_/]*$} $uri0]} { error "invalid request uri: \"$uri0\"" |
︙ | ︙ | |||
530 531 532 533 534 535 536 | puts $chan "Status: [dict get $wapp .reply-code]\r" } else { puts $chan "HTTP/1.0 [dict get $wapp .reply-code]\r" puts $chan "Server: wapp\r" puts $chan "Content-Length: [string length [dict get $wapp .reply]]\r" puts $chan "Connection: Closed\r" } | > | > | > > > | 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | puts $chan "Status: [dict get $wapp .reply-code]\r" } else { puts $chan "HTTP/1.0 [dict get $wapp .reply-code]\r" puts $chan "Server: wapp\r" puts $chan "Content-Length: [string length [dict get $wapp .reply]]\r" puts $chan "Connection: Closed\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]} { set val [wappInt-enc-url $val] puts $chan "Set-Cookie: $nm=$val; HttpOnly; Path=/\r" } } } puts $chan "\r" if {[string match text/* $mimetype]} { puts $chan [encoding convertto utf-8 [dict get $wapp .reply]] } else { puts $chan [dict get $wapp .reply] } flush $chan wappInt-close-channel $chan } # Process a single CGI request # proc wappInt-handle-cgi-request {} { |
︙ | ︙ |