From: Pat Thoyts Date: Wed, 23 Sep 2015 21:12:25 +0000 (+0200) Subject: Bug 708252: The XMLRPC API doesn't work with IIS X-Git-Tag: release-5.1.1~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdcb6f1f12aff458c43432856a33525f65909276;p=thirdparty%2Fbugzilla.git Bug 708252: The XMLRPC API doesn't work with IIS r=LpSolit --- diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index c28c3e10cb..33949ead0c 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -63,6 +63,12 @@ sub make_response { my $self = shift; my $cgi = Bugzilla->cgi; + # Fix various problems with IIS. + if ($ENV{'SERVER_SOFTWARE'} =~ /IIS/) { + $ENV{CONTENT_LENGTH} = 0; + binmode(STDOUT, ':bytes'); + } + $self->SUPER::make_response(@_); # XMLRPC::Transport::HTTP::CGI doesn't know about Bugzilla carrying around @@ -110,6 +116,8 @@ sub handle_login { if (none { $_ eq $method } $class->PUBLIC_METHODS) { ThrowCodeError('unknown_method', { method => $full_method }); } + + $ENV{CONTENT_LENGTH} = 0 if $ENV{'SERVER_SOFTWARE'} =~ /IIS/; $self->SUPER::handle_login($class, $method, $full_method); return; }