[1.1.6] rename functions and make SendFileResponse with a parameter for the folder (default resources), also put returntype boolean, add function that parse post params, if path is a dictionary try to load index.html

This commit is contained in:
BlubbFish 2019-04-03 20:53:10 +02:00
parent b3d60ad1ae
commit 41c8ccfee7
2 changed files with 3 additions and 3 deletions

View File

@ -42,5 +42,5 @@ using System.Runtime.InteropServices;
* 1.1.3 Variables parsing now as a String
* 1.1.4 add Woff as Binary type
* 1.1.5 add a function to send an object as json directly
* 1.1.6 rename functions and make SendFileResponse with a parameter for the folder
* 1.1.6 rename functions and make SendFileResponse with a parameter for the folder,
*/

View File

@ -48,8 +48,8 @@ namespace BlubbFish.Utils.IoT.Bots {
} else {
restr = restr.Substring(1);
}
if(restr == "") {
restr = "index.html";
if(Directory.Exists(folder + "/" + restr)) {
restr += "/index.html";
}
String end = restr.IndexOf('.') != -1 ? restr.Substring(restr.IndexOf('.') + 1) : "";
if(File.Exists(folder + "/" + restr)) {