Commit 40e28180 authored by Byron Jones's avatar Byron Jones

Bug 731219: Fix XMLRPC breakage when content-type contains a charset

r=dkl, a=LpSolit
parent ec2e4a09
......@@ -80,7 +80,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'} });
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment