tcl-hacks

Check-in [b1ecf5f008]
Login

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

Overview
Comment:prove binary and utf-8 coding
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tclish-args
Files: files | file ages | folders
SHA1:b1ecf5f008fe9938aaaef5461356d722874f2132
User & Date: aspect 2018-07-29 15:39:58
Context
2018-07-29
15:55
provide close, reject unused args from serve check-in: 6ead9e4e36 user: aspect tags: tclish-args
15:39
prove binary and utf-8 coding check-in: b1ecf5f008 user: aspect tags: tclish-args
15:35
add minhttpd.tm: as tiny as a useful httpd module can be check-in: 904a0d12e2 user: aspect tags: tclish-args
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/minhttpd-0.tm.

168
169
170
171
172
173
174
175



176
177
178
179
180
181
182
        if {$url eq "/"} {
            return -code 302 /index.html
        }
        if {$url eq "/admin"} {
            return -code 403 "You are not allowed!"
        }
        if {$url eq "/index.html"} {
            return "Hello, world!"



        }
        if {$url eq "/exit"} {
            after idle {incr ::forever}
            return "Exiting!"
        }
        if {$url eq "/empty"} {
            return ""







|
>
>
>







168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
        if {$url eq "/"} {
            return -code 302 /index.html
        }
        if {$url eq "/admin"} {
            return -code 403 "You are not allowed!"
        }
        if {$url eq "/index.html"} {
            return "(\u2713) Hello, world!"
        }
        if {$url eq "/binary"} {
            return -content-type application/octet-stream \x0d\xea\xd0\x0b\xee\xf0
        }
        if {$url eq "/exit"} {
            after idle {incr ::forever}
            return "Exiting!"
        }
        if {$url eq "/empty"} {
            return ""