Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# tdanz 9/12/2005 8:08 AM
Hi!

I have installed cuyahoga on the following platform:
- Debian Sarge 3.1
- MySQL
- Mono 1.0 runtime

The backend (Admin) works fine! But I have troubles with the UrlHelper.GetSiteUrl.
The Url is not the one displayed in the server.
Instead of
http://remas.mono.danzl.org/rmserver/
I receive
https://remas.mono.danzl.org/rmserver/

The problem is the same with apache and xsp. Does somebody know something about that?
As I know the apache is not configured to use SSL!

cu
Thomas

# martijnb 9/13/2005 12:57 AM
It seems that the HTTPS server variable is different with XSP and mod_mono. The UrlHelper.GetHostUrl() method checks it this way:
string https = HttpContext.Current.Request.ServerVariables["HTTPS"];
string protocol = https == "off" ? "http" : "https";

Probably, changing that to something like
string protocol = https == "on" ? "https" : "http";
will fix it.
# tdanz 9/13/2005 2:42 AM (edited 9/13/2005 4:17 AM)
This version workes for mono with xsp and Windows with IIS if I use HTTP. I do not have HTTPS for testing.
		
private static string GetHostUrl()
{
	string protocol = HttpContext.Current.Request.ServerVariables["SERVER_PORT_SECURE"];
	if (protocol == null || protocol == "0")
		protocol = "http";
	else
		protocol = "https";

//	string https = HttpContext.Current.Request.ServerVariables["HTTPS"];
//	string protocol = https != "off" ? "https" : "http";
	string serverPort = HttpContext.Current.Request.ServerVariables["SERVER_PORT"];
	string port = serverPort == "80" ? string.Empty : ":" + serverPort;
	string serverName = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
	return string.Format("{0}://{1}{2}" , protocol, serverName, port ); 
}
# martijnb 9/13/2005 4:38 AM
It looks like this needs some serious attention. Could you create a Jira issue for this?

Thanks.