Ignore:
Timestamp:
Aug 11, 2021, 6:22:03 PM (3 years ago)
Author:
alloc
Message:

Web:

  • Added SSE (ServerSentEvents) subsystem
  • Added log endpoint to SSE. Less heavy weight and more responsive way of watching the server log
  • Bunch of refactoring
File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/MapRendering/Web/Handlers/SessionHandler.cs

    r351 r367  
    77                private readonly string footer = "";
    88                private readonly string header = "";
    9                 private readonly Web parent;
    10                 private readonly string staticPart;
    119
    12                 public SessionHandler (string _staticPart, string _dataFolder, Web _parent, string _moduleName = null) :
    13                         base (_moduleName) {
    14                         staticPart = _staticPart;
    15                         parent = _parent;
    16 
     10                public SessionHandler (string _dataFolder, string _moduleName = null) : base (_moduleName) {
    1711                        if (File.Exists (_dataFolder + "/sessionheader.tmpl")) {
    1812                                header = File.ReadAllText (_dataFolder + "/sessionheader.tmpl");
     
    2620                public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,
    2721                        int _permissionLevel) {
    28                         string subpath = _req.Url.AbsolutePath.Remove (0, staticPart.Length);
     22                        string subpath = _req.Url.AbsolutePath.Remove (0, urlBasePath.Length);
    2923
    3024                        StringBuilder result = new StringBuilder ();
     
    5246                                        "<h1>Not logged in, <a href=\"/static/index.html\">click to return to main page</a>.</h1>");
    5347                        } else if (subpath.StartsWith ("login")) {
    54                                 string host = (Web.isSslRedirected (_req) ? "https://" : "http://") + _req.UserHostName;
     48                                string host = (Web.IsSslRedirected (_req) ? "https://" : "http://") + _req.UserHostName;
    5549                                string url = OpenID.GetOpenIdLoginUrl (host, host + "/session/verify");
    5650                                _resp.Redirect (url);
Note: See TracChangeset for help on using the changeset viewer.