]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 708252: The XMLRPC API doesn't work with IIS
authorPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 23 Sep 2015 21:14:46 +0000 (23:14 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 23 Sep 2015 21:14:46 +0000 (23:14 +0200)
r=LpSolit a=dkl

Bugzilla/WebService/Server/XMLRPC.pm

index 98a0ee405d1f118606777b8f91810230527c8b49..8deb253adc49282767532f91c2505dbdf627c916 100644 (file)
@@ -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
@@ -107,6 +113,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;
 }