Inets 3.0.1 and 3.0.3 bug

Sean Hinde earlyriser@REDACTED
Wed Apr 16 16:41:25 CEST 2003

The following esi callback generates broken HTTP

test1(Env, []) ->
      "<h1>Erlang Body</h1>",

The problem is that inets does not add the empty line at the end of the 
headers. The following patch fixes this case, though I haven't run any 
other regression tests.

Interestingly the only browser I found which actually still managed to 
load the page was IE on Windows. I can't imagine what algorithm they 
used to figure this out..

--- httpd_response.erl.orig     Mon Apr 14 18:41:28 2003
+++ httpd_response.erl  Wed Apr 16 15:38:44 2003
@@ -415,7 +415,7 @@
         {ok, Body} ->
             Header =
                 httpd_util:header(StatusCode,Info#mod.connection) ++
-               "Content-Length:" ++ content_length(Body),
+               "Content-Length:" ++ content_length(Body) ++"\r\n",
             httpd_socket:deliver(Type, Sock, [Header, Response]);

         {error, Reason} ->

More information about the erlang-questions mailing list