- Timestamp:
- Jan 27, 2023, 7:28:00 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/UrlHandlers/StaticHandler.cs
r399 r402 1 1 using System.IO; 2 2 using System.Net; 3 using AllocsFixes.FileCache;3 using Webserver.FileCache; 4 4 5 5 namespace Webserver.UrlHandlers { … … 11 11 public StaticHandler (string _filePath, AbstractCache _cache, bool _logMissingFiles, 12 12 string _moduleName = null) : base (_moduleName) { 13 datapath = _filePath + (_filePath [_filePath.Length - 1] == '/' ? "" : "/");13 datapath = $"{_filePath}{(_filePath [^1] == '/' ? "" : "/")}"; 14 14 cache = _cache; 15 15 logMissingFiles = _logMissingFiles; … … 19 19 string fn = _context.RequestPath.Remove (0, urlBasePath.Length); 20 20 21 byte[] content = cache.GetFileContent ( datapath + fn);21 byte[] content = cache.GetFileContent ($"{datapath}{fn}"); 22 22 23 23 if (content != null) { … … 28 28 _context.Response.StatusCode = (int) HttpStatusCode.NotFound; 29 29 if (logMissingFiles) { 30 Log.Warning ( "[Web] Static: FileNotFound: \"" + _context.RequestPath + "\" @ \"" + datapath + fn + "\"");30 Log.Warning ($"[Web] Static: FileNotFound: \"{_context.RequestPath}\" @ \"{datapath}{fn}\""); 31 31 } 32 32 }
Note:
See TracChangeset
for help on using the changeset viewer.