Skip to content

Commit

Permalink
Bug 1342795 - When urlbase is https, force the secure flag to be set …
Browse files Browse the repository at this point in the history
…on cookies.
  • Loading branch information
dylanwh committed Mar 26, 2017
1 parent b15cb6e commit dfb6888
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Bugzilla/CGI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,10 @@ sub header {
&& !$self->cookie('Bugzilla_login_request_cookie'))
{
my %args;
$args{'-secure'} = 1 if Bugzilla->params->{ssl_redirect};
my $params = Bugzilla->params;
if ($params->{ssl_redirect} || $params->{urlbase} =~ /^https/i) {
$args{'-secure'} = 1;
}

$self->send_cookie(-name => 'Bugzilla_login_request_cookie',
-value => generate_random_password(),
Expand Down
1 change: 1 addition & 0 deletions Bugzilla/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ sub i_am_webservice {
# (doing so can mess up XML-RPC).
sub do_ssl_redirect_if_required {
return if !i_am_cgi();
return if Bugzilla->params->{urlbase} =~ /^https/i;
return if !Bugzilla->params->{'ssl_redirect'};
return if !Bugzilla->params->{'sslbase'};

Expand Down

0 comments on commit dfb6888

Please sign in to comment.