Changeset 154 for binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/StaticHandler.cs
- Timestamp:
- Sep 2, 2014, 9:32:25 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/StaticHandler.cs
r138 r154 34 34 if (!fileCache.ContainsKey (fn)) { 35 35 if (!File.Exists (datapath + "/" + fn)) { 36 resp.StatusCode = (int)HttpStatusCode.NotFound; 37 if (logMissingFiles) 38 Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + "/" + fn + "\""); 39 return; 36 throw new FileNotFoundException (); 40 37 } 41 38 … … 49 46 } else { 50 47 if (!File.Exists (datapath + "/" + fn)) { 51 resp.StatusCode = (int)HttpStatusCode.NotFound; 52 if (logMissingFiles) 53 Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + "/" + fn + "\""); 54 return; 48 throw new FileNotFoundException (); 55 49 } 56 50 … … 61 55 resp.ContentLength64 = content.Length; 62 56 resp.OutputStream.Write (content, 0, content.Length); 57 } catch (FileNotFoundException e) { 58 resp.StatusCode = (int)HttpStatusCode.NotFound; 59 if (logMissingFiles) 60 Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + "/" + req.Url.AbsolutePath.Remove (0, staticPart.Length) + "\""); 61 return; 63 62 } catch (Exception e) { 64 63 Log.Out ("Error in StaticHandler.HandleRequest: " + e);
Note:
See TracChangeset
for help on using the changeset viewer.