Browse Source

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

pull/40/head
Teknikode 6 years ago
parent
commit
d0c8ed567c
  1. 9
      Teknik/Areas/Upload/Controllers/UploadController.cs

9
Teknik/Areas/Upload/Controllers/UploadController.cs

@ -283,7 +283,14 @@ namespace Teknik.Areas.Upload.Controllers @@ -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);
}
}
}

Loading…
Cancel
Save