Example #1
0
        public void SendFileResponse(HttpListenerContext context)
        {
            string url = context.Request.RawUrl;

            if (!FileExists(url))
            {
                return;
            }

            FileInfo fileInfo     = new FileInfo(GetFullPath(url));
            string   lastModified = fileInfo.LastWriteTime.ToString("R");

            if (RequestParser.LastModifiedSinceEquals(context.Request, lastModified))
            {
                responseWriter.SendNotModified(context.Response);
            }
            else
            {
                SendFileContent(context, fileInfo);
            }
        }