Skip to content

Commit

Permalink
Fix order of execution bug in html_response
Browse files Browse the repository at this point in the history
  • Loading branch information
xrchz committed Nov 17, 2017
1 parent aee3bf1 commit d5515a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions serverLib.sml
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,11 @@ in

fun html_response req =
let
val () = TextIO.output(TextIO.stdOut, html_response_header)
val () = TextIO.output(TextIO.stdOut, html ([header,body (req_body req)]))
in () end
val result = html ([header,body (req_body req)]) (* catch errors first *)
in
TextIO.output(TextIO.stdOut, html_response_header);
TextIO.output(TextIO.stdOut, result)
end

end

Expand Down

0 comments on commit d5515a1

Please sign in to comment.