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

Prejmenovani, callback pro cteni

parent 5ae3cf8c
Branches
Tags
No related merge requests found
package PiTube::Controller::NginxRTMP;
package PiTube::Controller::Nginx;
use Mojo::Base 'Mojolicious::Controller';
sub callback {
use constant HLS => qr/^\/hls\/([a-z0-9\-]+)(_\w+)?(\/\w+)?\.(m3u8|ts)$/i;
sub callback_rtmp {
my $c = shift;
if ( $c->param('call') =~ /publish/ ) {
......@@ -29,4 +31,20 @@ sub callback {
$c->render( status => 204, text => '' );
}
sub callback_hls {
my $c = shift;
$c->app->log->debug($c->req->headers->header('X-Original-URI'));
if ($c->req->headers->header('X-Original-URI') =~ HLS ) {
if ( $c->session->{user}{acl}{ $1 } ) {
$c->render( status => 204, text => '' );
return;
}
}
$c->render( status => 403, text => '');
}
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment