Add dedicated m3u page for nginx rewrite rules

This commit is contained in:
Laura Hausmann 2020-08-19 03:06:14 +02:00
parent 4e21eac397
commit 84746b226b
Signed by: zotan
GPG key ID: 5EC1D38FFC321311
2 changed files with 17 additions and 1 deletions

View file

@ -27,7 +27,7 @@ else
<a class="action-muted">[..]</a>
<a href="?@Model.path_oneup" class="entry-muted cfont"> Go back</a><br/>
<a class="action-muted">[--]</a>
<a href="/@(Request.QueryString).m3u" class="entry-muted cfont"> Download m3u</a><br/><br/>
<a href="/m3u@(Request.QueryString).m3u" class="entry-muted cfont"> Download m3u</a><br/><br/>
@foreach (var dir in Model.dirs)
{
<a class="action" href="#">[--]</a>

16
Pages/m3u.cshtml Normal file
View file

@ -0,0 +1,16 @@
@page
@using System.Web
@model IndexModel
@{
var path = HttpUtility.UrlDecode(Request.QueryString.Value.TrimStart('?'));
Layout = null;
Response.ContentType = "text/plain";
}
@if (Model.path.Contains(".."))
{
return;
}
@foreach (var file in Model.files)
{
@Html.Raw("https://" + Request.Host + "/" + Model.fullpath + "/" + file.Replace("?", "%3F") +"\n")
}