Skip to content

Commit

Permalink
Access URL addition in Request handled.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathy365 committed May 11, 2020
1 parent eb30b37 commit 3662a5a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Myrtille.Web/Default.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ private static JObject SecurdenWebRequest(string serverUrl, string requestUrl, s
}

ServicePointManager.ServerCertificateValidationCallback = TrustCertificate;
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
var uri = new Uri(requestUrl);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = requestMethod;
Expand Down Expand Up @@ -572,7 +573,20 @@ private JObject ProcessLaunchRequest(string serverUrl, string authKey)
{
JObject returnObj = null;
JObject paramObj = new JObject(new JProperty("AUTH_KEY", authKey));
JObject response = SecurdenWebRequest(serverUrl, "/launcher/verify_launch_info", "POST", paramObj);
JObject response = null;
if (Request["access_url"] != null && Request["access_url"].Trim() != "")
{
string accessUrl = Request["access_url"].Trim();
if (accessUrl.EndsWith("/"))
{
accessUrl = accessUrl.Substring(0, accessUrl.Length - 1);
}
response = SecurdenWebRequest(accessUrl, "/launcher/verify_launch_info", "POST", paramObj);
}
if (response == null)
{
response = SecurdenWebRequest(serverUrl, "/launcher/verify_launch_info", "POST", paramObj);
}
if (response == null)
{
Response.Write("<script>alert('Not able to access Securden web server. Try again.'); window.close();</script>");
Expand Down

0 comments on commit 3662a5a

Please sign in to comment.