From 1cc64de12bdb631bb83d2fcb87c265d7e683d07a Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Tue, 10 Sep 2019 17:04:34 +0200 Subject: [PATCH] also mp4 as binary --- Bot-Utils/Webserver.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Bot-Utils/Webserver.cs b/Bot-Utils/Webserver.cs index 7dc0d49..f6a2d67 100644 --- a/Bot-Utils/Webserver.cs +++ b/Bot-Utils/Webserver.cs @@ -59,7 +59,7 @@ namespace BlubbFish.Utils.IoT.Bots { String end = restr.IndexOf('.') != -1 ? restr.Substring(restr.IndexOf('.') + 1) : ""; if(File.Exists(folder + "/" + restr)) { try { - if(end == "png" || end == "jpg" || end == "jpeg" || end == "ico" || end == "woff") { + if(end == "png" || end == "jpg" || end == "jpeg" || end == "ico" || end == "woff" || end == "mp4") { Byte[] output = File.ReadAllBytes(folder + "/" + restr); switch(end) { case "ico": @@ -68,6 +68,9 @@ namespace BlubbFish.Utils.IoT.Bots { case "woff": cont.Response.ContentType = "font/woff"; break; + case "mp4": + cont.Response.ContentType = "video/mpeg"; + break; } cont.Response.OutputStream.Write(output, 0, output.Length); if(printOutput) {