SR Technology WTK Repo
Check-in [bd8435682a]
Not logged in

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

Overview
Comment:Corrected mime type for CSS.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bd8435682ae02716f87dbb420bf7bc25ea52ba46
User & Date: gerald 2013-01-22 18:31:22.824
Context
2014-08-01
23:01
Create new branch named "stever" Leaf check-in: 1d2dbde94c user: stever tags: stever
2013-02-05
02:15
Add logging methods. check-in: 04e9c7f911 user: gerald tags: trunk
2013-01-29
20:35
Re-implemented wtk in TclOO Thusfar the demo works check-in: f950e5cf61 user: seandeelywoods tags: hypnotoad
2013-01-22
18:31
Corrected mime type for CSS. check-in: bd8435682a user: gerald tags: trunk
02:04
Added support for .css files. check-in: d5b54df8b6 user: gerald tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to server.tcl.
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
			"*.gif"        {httpd returnfile $sock $url $url  "image/gif" [clock seconds] 1 -static }
			"*.png"        {httpd returnfile $sock $url $url  "image/png" [clock seconds] 1 -static }
			"*.jpg"        {httpd returnfile $sock $url $url  "image/jpeg" [clock seconds] 1 -static }
			"*.ico"        {httpd returnfile $sock $url $url  "image/x-icon" [clock seconds] 1 -static }
			"wtkpoll.html" {if !{[sendany $sock $query(sessionid)]} {error "pending"}}
			"wtkcb.html"   {fromclient $query(sessionid) $query(cmd)}
			"src.html"     {if {[catch {httpd return $sock [exec pygmentize -f html -O full,style=vs $query(f)]}]!=0} {httpd return $sock [filecontents $query(f)] -mimetype "text/plain"}}
			"*.css"        -
                        "*.html"       {httpd return $sock [filecontents $url]}
			"wsctrl"							{if {[ws_upgrade $sock [array get data]]} {error "websocket"}}
			default        {puts stderr "BAD URL $url"; httpd returnerror 404}
		}
	}
}

proc filecontents {fn} {set f [open $fn]; set d [read $f]; close $f; return $d}; # simple utility








|
|
|







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
			"*.gif"        {httpd returnfile $sock $url $url  "image/gif" [clock seconds] 1 -static }
			"*.png"        {httpd returnfile $sock $url $url  "image/png" [clock seconds] 1 -static }
			"*.jpg"        {httpd returnfile $sock $url $url  "image/jpeg" [clock seconds] 1 -static }
			"*.ico"        {httpd returnfile $sock $url $url  "image/x-icon" [clock seconds] 1 -static }
			"wtkpoll.html" {if !{[sendany $sock $query(sessionid)]} {error "pending"}}
			"wtkcb.html"   {fromclient $query(sessionid) $query(cmd)}
			"src.html"     {if {[catch {httpd return $sock [exec pygmentize -f html -O full,style=vs $query(f)]}]!=0} {httpd return $sock [filecontents $query(f)] -mimetype "text/plain"}}
			"*.css"        {httpd return $sock [filecontents $url] -mimetype "text/css"}
                        "*.html"       {httpd return $sock [filecontents $url] -mimetype "text/html"}
			"wsctrl"       {if {[ws_upgrade $sock [array get data]]} {error "websocket"}}
			default        {puts stderr "BAD URL $url"; httpd returnerror 404}
		}
	}
}

proc filecontents {fn} {set f [open $fn]; set d [read $f]; close $f; return $d}; # simple utility