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

Podpora volneho pristupu l verejnym streamum

parent 46a25b24
No related branches found
No related tags found
No related merge requests found
...@@ -86,15 +86,20 @@ sub callback_recorder { ...@@ -86,15 +86,20 @@ sub callback_recorder {
sub callback_hls { sub callback_hls {
my $c = shift; my $c = shift;
my $code = 403;
if ($c->req->headers->header('X-Original-URI') =~ HLS ) { if ($c->req->headers->header('X-Original-URI') =~ HLS ) {
if ( $c->session->{user}{acl}{ $1 } & 4 ) { #TODO: constant $code = 204 if $c->session->{user}{acl}{ $1 } & 4;
$c->render( status => 204, text => '' );
return; if (! $code) {
my $is_public = $c->schema->resultset('Stream')->count({
key => $1, is_public => 't'
});
$code = 204 if $is_public;
} }
} }
$c->render( status => 403, text => ''); $c->render( status => $code, text => '');
} }
sub callback_record { sub callback_record {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment