Skip to content
Snippets Groups Projects
Verified Commit 66dfcfba authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Neposilame soubory

parent 6060b574
No related branches found
No related tags found
No related merge requests found
......@@ -53,33 +53,8 @@ sub player {
$c->render();
}
sub hls {
my $c = shift;
if ( $c->req->url !~ /^\/hls\/([a-z0-9\-]+)(_\w+)?(\/\w+)?\.(m3u8|ts)$/i ) {
$c->render( status => 404, text => '');
return;
}
my ($key, $type, $file) = ($1, $4, $c->req->url);
if ( ! -f $file ) {
$c->render( status => 404, text => '' );
return;
}
if ( $type eq 'ts' ) { # manifesty necheckujeme
if ( ! $c->session->{user}{acl}{ $key } ) {
$c->render( status => 403, text => '');
return;
}
}
$c->res->headers->content_type(CONTENT_TYPE->{$type});
$c->res->headers->cache_control('max-age=0, no-cache');
$c->res->headers->access_control_allow_origin('*');
$c->reply->file($file);
1;
}
__END__
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment