Update patch for fixing double Traefik headers

This commit is contained in:
Daniel Berteaud 2024-04-09 15:39:34 +02:00
parent 579f78b689
commit d330992b4f
1 changed files with 7 additions and 1 deletions

View File

@ -36,10 +36,16 @@ sub _run {
sub handler {
my ( $self, $req ) = @_;
# See https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/merge_requests/480
my @convertedHdrs =
( 'Content-Length' => 0, Cookie => ( $req->env->{HTTP_COOKIE} // '' ) );
while ( my ( $k, $v ) = splice( @{ $req->{respHeaders} }, 0, 2 ) ) {
push @convertedHdrs, $k, $v;
if ( $k =~ /^(?:Deleteheader\d+|Cookie)$/ ) {
next;
}
else {
push @convertedHdrs, $k, $v;
}
}
return [ 200, \@convertedHdrs, [] ];
}