// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
+// (C) 2003-2009 Novell, Inc (http://novell.com)
//
//
{
class StaticFileHandler : IHttpHandler
{
- static bool runningWindows = RunningOnWindows ();
-
- static bool RunningOnWindows ()
- {
- int pid = (int)Environment.OSVersion.Platform;
- return (pid != 4 && pid != 128);
- }
-
static bool ValidFileName (string fileName)
{
- if (!runningWindows)
+ if (!RuntimeHelpers.RunningOnWindows)
return true;
if (fileName == null || fileName.Length == 0)
HttpRequest request = context.Request;
HttpResponse response = context.Response;
-#if NET_2_0
if (HostingEnvironment.HaveCustomVPP) {
VirtualFile vf = null;
VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider;
throw new HttpException (404, "Path '" + vpath + "' was not found.", vpath);
response.ContentType = MimeTypes.GetMimeType (vpath);
- response.TransmitFile (vf);
+ response.TransmitFile (vf, true);
return;
}
-#endif
string fileName = request.PhysicalPath;
FileInfo fi = new FileInfo (fileName);