Subject: | Net:::HTTPServer gives error code 406 in win32 |
First I had to comment out the blocking stuff. Then it was a problem when the code checked what document types the browser accepts. The accept header was examined with the trailing DOS newline not removed. This patch removes that check.
*** HTTPServer.pm Wed May 19 23:06:56 2004
--- HTTPServer-org.pm Tue May 18 16:36:20 2004
***************
*** 592,598 ****
$self->{SOCK} = new IO::Socket::INET(LocalPort=>$port,
Proto=>"tcp",
Listen=>10,
! Reuse=>1);
}
else
{
--- 592,599 ----
$self->{SOCK} = new IO::Socket::INET(LocalPort=>$port,
Proto=>"tcp",
Listen=>10,
! Reuse=>1,
! Blocking=>0);
}
else
{
***************
*** 937,943 ****
$headers{'__TRACE__'} = $request if ($method eq "TRACE");
! my ($headers,$body) = ($request =~ /^(.+?)\r?\n\n?\r(.*?)$/s);
$self->_debug("REQ","_ReadRequest: headers($headers)");
$self->_debug("REQ","_ReadRequest: body($body)");
--- 938,944 ----
$headers{'__TRACE__'} = $request if ($method eq "TRACE");
! my ($headers,$body) = ($request =~ /^(.+?)\r?\n\r?\n(.*?)$/s);
$self->_debug("REQ","_ReadRequest: headers($headers)");
$self->_debug("REQ","_ReadRequest: body($body)");
***************
*** 1390,1396 ****
my $self = shift;
my $client = shift;
! #$self->_nonblock($client);
my $select = new IO::Select($client);
my $request = "";
--- 1391,1397 ----
my $self = shift;
my $client = shift;
! $self->_nonblock($client);
my $select = new IO::Select($client);
my $request = "";
***************
*** 1730,1736 ****
$accept =~ s/\s*\,\s*/\,/g;
$accept =~ s/\s*\;\s*/\;/g;
- $accept =~ s/[\r\n]+$//;
my ($mainType,$subType) = split("/",$contentType,2);
--- 1731,1736 ----