forked from j62/ctbrec
Protect only the playlists with HMAC
Ignore HMAC authentication for segments, so that media players can access the segments without the server having to manipulate the playlist and add an hmac for every segment
This commit is contained in:
parent
917dbbadaa
commit
d7ba8b2978
|
@ -36,6 +36,8 @@ public class HlsServlet extends AbstractCtbrecServlet {
|
|||
File recordingsDir = new File(config.getSettings().recordingsDir);
|
||||
File requestedFile = new File(recordingsDir, request);
|
||||
|
||||
if (requestedFile.getCanonicalPath().startsWith(config.getSettings().recordingsDir)) {
|
||||
if (requestedFile.getName().equals("playlist.m3u8")) {
|
||||
try {
|
||||
boolean isRequestAuthenticated = checkAuthentication(req, req.getRequestURI());
|
||||
if (!isRequestAuthenticated) {
|
||||
|
@ -51,9 +53,6 @@ public class HlsServlet extends AbstractCtbrecServlet {
|
|||
return;
|
||||
}
|
||||
|
||||
if (requestedFile.getCanonicalPath().startsWith(config.getSettings().recordingsDir)) {
|
||||
if (requestedFile.getName().equals("playlist.m3u8")) {
|
||||
|
||||
try {
|
||||
servePlaylist(req, resp, requestedFile);
|
||||
} catch (ParseException | PlaylistException e) {
|
||||
|
|
Loading…
Reference in New Issue