Ignore:
Timestamp:
Jan 27, 2023, 7:28:00 PM (22 months ago)
Author:
alloc
Message:
  • Major refactoring
  • Using Utf8Json for (de)serialization
  • Moving APIs to REST
  • Removing dependencies from WebServer and MapRenderer to ServerFixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements2/WebServer/src/UrlHandlers/StaticHandler.cs

    r399 r402  
    11using System.IO;
    22using System.Net;
    3 using AllocsFixes.FileCache;
     3using Webserver.FileCache;
    44
    55namespace Webserver.UrlHandlers {
     
    1111                public StaticHandler (string _filePath, AbstractCache _cache, bool _logMissingFiles,
    1212                        string _moduleName = null) : base (_moduleName) {
    13                         datapath = _filePath + (_filePath [_filePath.Length - 1] == '/' ? "" : "/");
     13                        datapath = $"{_filePath}{(_filePath [^1] == '/' ? "" : "/")}";
    1414                        cache = _cache;
    1515                        logMissingFiles = _logMissingFiles;
     
    1919                        string fn = _context.RequestPath.Remove (0, urlBasePath.Length);
    2020
    21                         byte[] content = cache.GetFileContent (datapath + fn);
     21                        byte[] content = cache.GetFileContent ($"{datapath}{fn}");
    2222
    2323                        if (content != null) {
     
    2828                                _context.Response.StatusCode = (int) HttpStatusCode.NotFound;
    2929                                if (logMissingFiles) {
    30                                         Log.Warning ("[Web] Static: FileNotFound: \"" + _context.RequestPath + "\" @ \"" + datapath + fn + "\"");
     30                                        Log.Warning ($"[Web] Static: FileNotFound: \"{_context.RequestPath}\" @ \"{datapath}{fn}\"");
    3131                                }
    3232                        }
Note: See TracChangeset for help on using the changeset viewer.