1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Added check for html files on upload and return them as plain text.

This commit is contained in:
Uncled1023 2016-11-02 21:47:00 -07:00
parent 7def4f222d
commit d0c8ed567c

View File

@ -283,7 +283,14 @@ namespace Teknik.Areas.Upload.Controllers
Response.AppendHeader("Content-Disposition", cd.ToString());
return File(data, upload.ContentType);
string contentType = upload.ContentType;
// We need to prevent html (make cleaner later)
if (contentType == "text/html")
{
contentType = "text/plain";
}
return File(data, contentType);
}
}
}