- Timestamp:
- Aug 1, 2022, 12:54:31 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/MapRendering/Web/Handlers/ItemIconHandler.cs
r369 r382 4 4 using System.Net; 5 5 using UnityEngine; 6 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest; 7 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse; 6 8 using Object = UnityEngine.Object; 7 9 8 10 namespace AllocsFixes.NetConnections.Servers.Web.Handlers { 9 public class ItemIconHandler : PathHandler {11 public class ItemIconHandler : AbsHandler { 10 12 private readonly Dictionary<string, byte[]> icons = new Dictionary<string, byte[]> (); 11 13 private readonly bool logMissingFiles; … … 24 26 public static ItemIconHandler Instance { get; private set; } 25 27 26 public override void HandleRequest ( HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,28 public override void HandleRequest (string _requestPath, HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _con, 27 29 int _permissionLevel) { 28 30 if (!loaded) { … … 32 34 } 33 35 34 string requestFileName = _req .Url.AbsolutePath.Remove (0, urlBasePath.Length);36 string requestFileName = _requestPath.Remove (0, urlBasePath.Length); 35 37 requestFileName = requestFileName.Remove (requestFileName.LastIndexOf ('.')); 36 38 37 if (icons.ContainsKey (requestFileName) && _req .Url.AbsolutePath.EndsWith (".png", StringComparison.OrdinalIgnoreCase)) {39 if (icons.ContainsKey (requestFileName) && _requestPath.EndsWith (".png", StringComparison.OrdinalIgnoreCase)) { 38 40 _resp.ContentType = MimeType.GetMimeType (".png"); 39 41 … … 45 47 _resp.StatusCode = (int) HttpStatusCode.NotFound; 46 48 if (logMissingFiles) { 47 Log.Out ("Web:IconHandler:FileNotFound: \"" + _req .Url.AbsolutePath + "\" ");49 Log.Out ("Web:IconHandler:FileNotFound: \"" + _requestPath + "\" "); 48 50 } 49 51 }
Note:
See TracChangeset
for help on using the changeset viewer.