diff --git a/lib/http_server.pl b/lib/http_server.pl index f3a126bde..25bb7d740 100644 --- a/lib/http_server.pl +++ b/lib/http_server.pl @@ -1620,7 +1620,10 @@ sub html_file { print "db web file cache check: f=$file t=$time2/$time3\n" if $main::Debug{http}; if ( $time3 <= $time2 ) { - return "HTTP/1.0 304 Not Modified\nServer: MisterHouse\n\n"; + my $html_head = "HTTP/1.1 304 Not Modified\r\n"; + $html_head .= "Server: MisterHouse\r\n"; + $html_head .= "Date: " . time2str(time) . "\r\n"; + $html_head .= "\r\n"; } } @@ -1889,7 +1892,7 @@ sub mime_header { } # print "dbx2 m=$mime f=$file_or_type\n"; - my $code = "HTTP/1.0 200 OK"; + my $code = "HTTP/1.1 200 OK"; $code = "HTTP/1.1 206 Partial Content" if $range; my $header = "$code\nServer: MisterHouse\nContent-Type: $mime\n"; @@ -1933,21 +1936,18 @@ sub html_alias { # Responses documented here: http://www.w3.org/Protocols/HTTP/HTRESP.html sub html_no_response { - - return < $style $title @@ -2013,22 +2008,20 @@ sub html_page { "; - my $extraheaders = ''; - $extraheaders .= $Cookie . "\n\r" if $Cookie; - $extraheaders .= $frame . "\n\r" if $frame; - $extraheaders .= "\n\r" if $extraheaders; - # Not sure how important length is, but pretty cheap and easy to do - $html =~ s/\n/\n\r/g; # Bill S. says this is required to be standards compiliant - return < eof +my $html_head = "HTTP/1.1 200 OK\r\n"; +$html_head .= "Server: MisterHouse\r\n"; +$html_head .= "Content-type: text/xml\r\n"; +$html_head .= "Content-Length: " . ( length $html ) . "\r\n"; +$html_head .= "Date: " . time2str(time) . "\r\n"; +$html_head .= "\r\n"; + +return $html_head.$html; } # vxml for audio text/wav followed by a goto @@ -3645,9 +3639,6 @@ sub dir_index { sub wml_page { my ($wml) = @_; $wml = <<"eof"; -HTTP/1.0 200 OK -Server: MisterHouse -Content-Type: text/vnd.wap.wml eof - return $wml; + + my $html_head = "HTTP/1.1 200 OK\r\n"; + $html_head .= "Server: MisterHouse\r\n"; + $html_head .= "Content-type: text/vnd.wap.wml\r\n"; + $html_head .= "Content-Length: " . ( length $wml ) . "\r\n"; + $html_head .= "Date: " . time2str(time) . "\r\n"; + $html_head .= "\r\n"; + + return $html_head.$wml; } return 1; # Make require happy diff --git a/lib/xml_server.pl b/lib/xml_server.pl index 458109be5..58eff1ee3 100644 --- a/lib/xml_server.pl +++ b/lib/xml_server.pl @@ -496,10 +496,7 @@ sub xml_page { # handle blank xsl name my $style; $style = qq|| if $xsl; - return < $style @@ -508,6 +505,14 @@ sub xml_page { eof +my $html_head = "HTTP/1.1 200 OK\r\n"; +$html_head .= "Server: MisterHouse\r\n"; +$html_head .= "Content-type: text/xml\r\n"; +$html_head .= "Content-Length: " . ( length $html ) . "\r\n"; +$html_head .= "Date: " . time2str(time) . "\r\n"; +$html_head .= "\r\n"; + +return $html_head.$html; } sub xml_entities_encode { @@ -522,22 +527,23 @@ sub xml_entities_encode { sub svg_page { my ($svg) = @_; - return < @@ -582,7 +588,14 @@ sub xml_usage { eof - return $html; + my $html_head = "HTTP/1.1 200 OK\r\n"; + $html_head .= "Server: MisterHouse\r\n"; + $html_head .= "Content-type: text/html\r\n"; + $html_head .= "Content-Length: " . ( length $html ) . "\r\n"; + $html_head .= "Date: " . time2str(time) . "\r\n"; + $html_head .= "\r\n"; + + return $html_head.$html; } return 1; # Make require happy