This commit is contained in:
Xavier Guimard 2019-02-01 09:52:28 +01:00
parent 27c7e3750e
commit 681481b0a1
3 changed files with 5 additions and 6 deletions

View File

@ -19,6 +19,7 @@
auth_request_set $headername10 $upstream_http_headername10;
auth_request_set $headervalue10 $upstream_http_headervalue10;
auth_request_set $lmcookie $upstream_http_cookie;
add_header Set-Cookie $lmcookie;
access_by_lua '
i = 1
ngx.req.set_header("Cookie",ngx.var.lmcookie)

View File

@ -27,10 +27,11 @@ sub set_header_in {
sub unset_header_in {
my ( $class, $req, $header ) = @_;
$req->{respHeaders} = [ grep { $_ ne $header } @{ $req->{respHeaders} } ];
$req->{respHeaders} = [ grep { $_ ne $header and $_ ne cgiName($header) }
@{ $req->{respHeaders} } ];
delete $req->{env}->{ cgiName($header) };
$header =~ s/-/_/g;
delete $req->{env}->{$header};
delete $req->{env}->{"HTTP_$header"};
}
# Inheritence is broken in this case with Debian >= jessie

View File

@ -67,11 +67,8 @@ sub handler {
my ( $self, $req ) = @_;
my $hdrs = $req->{respHeaders};
$req->{respHeaders} = [];
my $cookie = $req->env->{HTTP_COOKIE};
my $cn = $self->Lemonldap::NG::Handler::Main::tsv->{cookieName};
$cookie =~ s/\b$cn(http)?=[^,;]*[,;\s]*//og;
my @convertedHdrs =
( 'Content-Length' => 0, Cookie => ( $cookie // '' ) );
( 'Content-Length' => 0, Cookie => ( $req->env->{HTTP_COOKIE} // '' ) );
my $i = 0;
while ( my $k = shift @$hdrs ) {
my $v = shift @$hdrs;