# HG changeset patch # User Mike Pavone # Date 1290458283 0 # Node ID 804e48af102705119e019ed1d568f7ab21f8caf1 # Parent f582fd6c75eeb066d882ee3972043fe3a349a1dc Fix file not found handling diff -r f582fd6c75ee -r 804e48af1027 webserver.rhope --- a/webserver.rhope Mon Nov 22 01:37:05 2010 -0500 +++ b/webserver.rhope Mon Nov 22 20:38:03 2010 +0000 @@ -129,16 +129,18 @@ ,newpath <- [path]Slice[1] Good Path?[newpath] { - file <- Open[File[newpath],"r"] + file,bad file <- Open[File[newpath],"r"] content length <- Length[file] - If[[content length] > [0]] + ,bad file <- If[[content length] > [0]] { data <- [file]Read[content length] [[HTTP OK[client, Get Content Type[path], content length, Dictionary[]] ]Write[data] ]Close { Close[file] } - }{ + } + Val[bad file] + { HTTP Not Found[client] } }{