From: Byron Jones Date: Wed, 29 Feb 2012 04:47:25 +0000 (+0800) Subject: Bug 731219: Fix XMLRPC breakage when content-type contains a charset X-Git-Tag: bugzilla-4.0.6~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=489e478a7b9c03c932a6fb758c510312557750c0;p=thirdparty%2Fbugzilla.git Bug 731219: Fix XMLRPC breakage when content-type contains a charset r=dkl, a=LpSolit --- diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index 94d44fd019..936e40fa57 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -79,7 +79,10 @@ sub deserialize { my $self = shift; # Only allow certain content types to protect against CSRF attacks - if (!grep($_ eq $ENV{'CONTENT_TYPE'}, XMLRPC_CONTENT_TYPE_WHITELIST)) { + my $content_type = lc($ENV{'CONTENT_TYPE'}); + # Remove charset, etc, if provided + $content_type =~ s/^([^;]+);.*/$1/; + if (!grep($_ eq $content_type, XMLRPC_CONTENT_TYPE_WHITELIST)) { ThrowUserError('xmlrpc_illegal_content_type', { content_type => $ENV{'CONTENT_TYPE'} }); }