lemonldap-ng/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/PSGI/Server.pm

32 lines
802 B
Perl
Raw Normal View History

package Lemonldap::NG::Handler::PSGI::Server;
use strict;
use Mouse;
2016-01-26 07:14:54 +01:00
use Lemonldap::NG::Handler::SharedConf qw(:tsv);
extends 'Lemonldap::NG::Handler::PSGI';
## @method void _run()
# Return subroutine that add headers stored in $req->{respHeaders} in
# response returned by router()
#
sub _run {
my ($self) = @_;
return sub {
my $res = $self->router( $_[0] );
push @{ $res->[1] }, %{ $_[0]->{respHeaders} };
return $res;
};
}
## @method PSGI-Response router($req)
2016-01-30 13:26:14 +01:00
# If PSGI is used as an authentication FastCGI only, this method will be
# called for authenticated users and returns only 200. Headers are set by
# Lemonldap::NG::Handler::PSGI.
2016-01-30 13:26:14 +01:00
# @param $req Lemonldap::NG::Common::PSGI::Request
sub router {
return [ 200, [ 'Content-Length', 0 ], [] ];
}
1;