From: Dave Lawrence Date: Mon, 15 Jul 2013 03:47:22 +0000 (-0400) Subject: Bug 787328 - xmlrpc.cgi doesn't send any security-related headers X-Git-Tag: bugzilla-4.2.7~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=225d5430bc810f005c993d9f5234ffc47c4429c2;p=thirdparty%2Fbugzilla.git Bug 787328 - xmlrpc.cgi doesn't send any security-related headers r=glob,a=justdave --- diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index 025fb8f192..fc297421a2 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -61,8 +61,16 @@ sub make_response { # XMLRPC::Transport::HTTP::CGI doesn't know about Bugzilla carrying around # its cookies in Bugzilla::CGI, so we need to copy them over. - foreach (@{Bugzilla->cgi->{'Bugzilla_cookie_list'}}) { - $self->response->headers->push_header('Set-Cookie', $_); + foreach my $cookie (@{Bugzilla->cgi->{'Bugzilla_cookie_list'}}) { + $self->response->headers->push_header('Set-Cookie', $cookie); + } + + # Copy across security related headers from Bugzilla::CGI + foreach my $header (split(/[\r\n]+/, Bugzilla->cgi->header)) { + my ($name, $value) = $header =~ /^([^:]+): (.*)/; + if (!$self->response->headers->header($name)) { + $self->response->headers->header($name => $value); + } } }