# HTTP/1.x headers
require "mime.pl";

sub printHeader
{
	($code,$buflen,$head)=@_;
	printCode($code);
	print "Date: ".$ENV{DATE}."\r\n";
	print "Server: Screws - ".$ENV{VERSION}." on ".$OS." perled.\r\n";
	print "Connection: close\r\n";
	if ($head == 0)
	{
	print "Content-Type: "; 
	if (fileCode("$ENV{FILE}") eq "200")
		{ print mimeType("$ENV{FILETYPE}"); } 
	else	{ print "text/html"; }
	print "; charset=iso-8859-1\r\n";
	}
	print "Accept-Ranges: bytes\r\n";
	print "Content-Length: ".$buflen."\r\n";
#	print "\r\n";
}

return 1;
