Hi there,<br><br>a normal HTTP 301 response should look like this:<br><br>HTTP/1.1 301 Moved Permanently<br>Date: Sun, 09 Dec 2007 10:54:02 GMT<br>Server: Apache/1.3.37 (Unix) PHP/4.4.4 with Suhosin-Patch FrontPage/5.0.2.4803 mod_fastcgi/mod_fastcgi-SNAP-0404142202 mod_ssl/2.8.28 OpenSSL/0.9.6i
<br>Location: <a href="http://www.spielendverdienen.de/startseite.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.spielendverdienen.de/startseite.html</a><br><br>However, some servers return
<br><br>HTTP/1.1 301<br>Date: Sun, 09 Dec 2007 10:52:58 GMT<br>
Server: Apache/1.3.37 (Unix) FrontPage/5.0.2.2623 mod_ssl/2.8.28 OpenSSL/0.9.8a<br>Location: <a href="http://charmed.qanet.de/en/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://charmed.qanet.de/en/
</a><br><br>(notice the first line, in the second response the reason is missing)
<br><br>When requesting a page from a server that returns the second http-response, erlang crashes:<br><br>27> http:request("<a href="http://charmed.qanet.de/">http://charmed.qanet.de/</a>",foo).<br>{error,{badarg,[{erlang,list_to_integer,["301\r\nDate:"]},
<br> {httpc_response,parse_status_code,4},<br> {httpc_handler,handle_info,2},<br> {gen_server,handle_msg,5},<br> {proc_lib,init_p,5}]}}<br><br>=ERROR REPORT==== 9-Dec-2007::14:04:08 ===
<br>** Generic server <0.106.0> terminating<br>** Last message in was {tcp,#Port<0.185>,<br> <<"HTTP/1.1 301\r\nDate: Sun, 09 Dec 2007 13:04:18 G<br>MT\r\nServer: Apache/1.3.37 (Unix) FrontPage/5.0.2.2623 mod_ssl/2.8.28 OpenSSL/0
<br>.9.8a\r\nLocation: <a href="http://charmed.qanet.de/en/\r\nKeep-Alive">http://charmed.qanet.de/en/\r\nKeep-Alive</a>: timeout=15, max=10<br>0\r\nConnection: Keep-Alive\r\nTransfer-Encoding: chunked\r\nContent-Type: text/
<br>html\r\n\r\n">>}<br>** When Server state == {state,<br> {request,#Ref<0.0.0.444>,<0.62.0>,0,http,<br> {"<a href="http://charmed.qanet.de">
charmed.qanet.de</a>",80},<br> "/",[],get,<br> {http_request_h,undefined,"keep-alive",<br> undefined,undefined,undefined,undefined,
<br> undefined,undefined,undefined,undefined,<br> undefined,undefined,undefined,undefined,<br> undefined,undefined,"
<a href="http://charmed.qanet.de">charmed.qanet.de</a>",<br> undefined,undefined,undefined,undefined,<br> undefined,undefined,undefined,undefined,
<br> undefined,[],undefined,undefined,<br> undefined,undefined,"0",undefined,<br> undefined,undefined,undefined,undefined,
<br> undefined,[]},<br> {[],[]},<br> {http_options,infinity,true,[],undefined,<br> false},
<br> "<a href="http://charmed.qanet.de/">http://charmed.qanet.de/</a>",[],none,[]},<br> {tcp_session,<br> {{"<a href="http://charmed.qanet.de">
charmed.qanet.de</a>",80},<0.106.0>},<br> false,http,#Port<0.185>,1},<br> undefined,undefined,undefined,<br> {httpc_response,parse,[nolimit]},
<br> {[],[]},<br> new,[],nolimit,nolimit,<br> {options,<br> {undefined,[]},<br> 0,2,2,enabled,enabled,false},
<br> {timers,[],undefined},<br> httpc_manager_foo,undefined}<br>** Reason for termination ==<br>** {badarg,[{erlang,list_to_integer,["301\r\nDate:"]},<br> {httpc_response,parse_status_code,4},
<br> {httpc_handler,handle_info,2},<br> {gen_server,handle_msg,5},<br> {proc_lib,init_p,5}]}<br>28><br><br>Therefore, I'd like to replace the first line of the incoming server response from "HTTP/1.1 301\r\n" to "HTTP/1.1 301 Moved Permanently\r\n", but I can't seem to find where the appropriate to do so would be...
<br><br>Can you help me with this?<br><br>