From 84746b226b00c1000f2aa33805fefba35b683682 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Wed, 19 Aug 2020 03:06:14 +0200 Subject: [PATCH] Add dedicated m3u page for nginx rewrite rules --- Pages/Index.cshtml | 2 +- Pages/m3u.cshtml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 Pages/m3u.cshtml diff --git a/Pages/Index.cshtml b/Pages/Index.cshtml index 7086b13..ed2a984 100644 --- a/Pages/Index.cshtml +++ b/Pages/Index.cshtml @@ -27,7 +27,7 @@ else [..] Go back
[--] - Download m3u

+ Download m3u

@foreach (var dir in Model.dirs) { [--] diff --git a/Pages/m3u.cshtml b/Pages/m3u.cshtml new file mode 100644 index 0000000..a27eac8 --- /dev/null +++ b/Pages/m3u.cshtml @@ -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") +}