Changeset 311


Ignore:
Timestamp:
Aug 26, 2017, 8:00:09 PM (7 years ago)
Author:
alloc
Message:

Fixes 14_16_22

Location:
binary-improvements/MapRendering
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/MapRendering/ModInfo.xml

    r309 r311  
    55                <Description value="Render the game map to image map tiles as it is uncovered" />
    66                <Author value="Christian 'Alloc' Illy" />
    7                 <Version value="21" />
     7                <Version value="22" />
    88                <Website value="http://7dtd.illy.bz" />
    99        </ModInfo>
  • binary-improvements/MapRendering/Web/Handlers/SessionHandler.cs

    r244 r311  
    5252                                }
    5353                        } else if (subpath.StartsWith ("login")) {
    54                                 string host = (parent.isSslRedirected ? "https://" : "http://") + req.UserHostName;
     54                                string host = (Web.isSslRedirected (req) ? "https://" : "http://") + req.UserHostName;
    5555                                string url = OpenID.GetOpenIdLoginUrl (host, host + "/session/verify");
    5656                                resp.Redirect (url);
  • binary-improvements/MapRendering/Web/Web.cs

    r309 r311  
    2424                private bool useStaticCache = false;
    2525
    26                 public bool isSslRedirected {
    27                         private set;
    28                         get;
     26                public static bool isSslRedirected (HttpListenerRequest req) {
     27                        string proto = req.Headers ["X-Forwarded-Proto"];
     28                        if (!string.IsNullOrEmpty (proto)) {
     29                                return proto.Equals ("https", StringComparison.OrdinalIgnoreCase);
     30                        }
     31
     32                        return false;
    2933                }
    3034
     
    4448
    4549                                // TODO: Read from config
    46                                 isSslRedirected = false;
    4750                                useStaticCache = false;
    4851
Note: See TracChangeset for help on using the changeset viewer.