Ignore:
Timestamp:
Aug 1, 2022, 12:54:31 PM (2 years ago)
Author:
alloc
Message:

Switched to use SpaceWizards.HttpListener

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements2/MapRendering/Web/Handlers/StaticHandler.cs

    r367 r382  
    22using System.Net;
    33using AllocsFixes.FileCache;
     4using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest;
     5using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;
    46
    57namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
    6         public class StaticHandler : PathHandler {
     8        public class StaticHandler : AbsHandler {
    79                private readonly AbstractCache cache;
    810                private readonly string datapath;
     
    1618                }
    1719
    18                 public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,
     20                public override void HandleRequest (string _requestPath, HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _con,
    1921                        int _permissionLevel) {
    20                         string fn = _req.Url.AbsolutePath.Remove (0, urlBasePath.Length);
     22                        string fn = _requestPath.Remove (0, urlBasePath.Length);
    2123
    2224                        byte[] content = cache.GetFileContent (datapath + fn);
     
    2931                                _resp.StatusCode = (int) HttpStatusCode.NotFound;
    3032                                if (logMissingFiles) {
    31                                         Log.Out ("Web:Static:FileNotFound: \"" + _req.Url.AbsolutePath + "\" @ \"" + datapath + fn + "\"");
     33                                        Log.Out ("Web:Static:FileNotFound: \"" + _requestPath + "\" @ \"" + datapath + fn + "\"");
    3234                                }
    3335                        }
Note: See TracChangeset for help on using the changeset viewer.