Browse Source

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

tags/2.0.6
Teknikode 3 years ago
parent
commit
d0c8ed567c
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      Teknik/Areas/Upload/Controllers/UploadController.cs

+ 8
- 1
Teknik/Areas/Upload/Controllers/UploadController.cs 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);
}
}
}

Loading…
Cancel
Save