Thanks for the code, this is all very puzzling, I still cannot make it work for me. Attached is a proposed version 0.13 which does the path processing in a different way which should be safer.
Regards,
Stephen
On Wed Oct 04 13:11:36 2017, PERLMAX wrote:
Show quoted text> Hello,
>
> I use HTTP::Server::Simple::Static version 0.12 and
> HTTP::Server::Simple version 0.510.0 from Mageia Linux 6.
>
> My test script is easy:
>
> package MyServer;
>
> use base qw(HTTP::Server::Simple::CGI);
> use HTTP::Server::Simple::Static;
>
> my $webroot = '/home/maximilian/public_html/static/static';
>
> sub handle_request {
> my ( $self, $cgi ) = @_;
>
> if ( !$self->serve_static( $cgi, $webroot ) ) {
> print "HTTP/1.0 404 Not found\r\n";
> print $cgi->header,
> $cgi->start_html('Not found'),
> $cgi->h1('Not found'),
> $cgi->end_html;
> }
> }
>
> package main;
>
> my $server = MyServer->new();
> $server->run();
>
> The server runs under my personal account, which of course has the
> permission to read /etc/passwd...
>
> Best wishes,
> Max