changed config/config.php to add ['REQUEST_PROTOCOL'].
changed the subversion repository anchor to have the trailing slash
This commit is contained in:
		| @ -86,9 +86,16 @@ api_base_url = "http://127.0.0.1" | ||||
| ; https://${SERVER_NAME}/svn. | ||||
| ; You may specify multiple URLs separated with a comma as shown below: | ||||
| ;   "http://${SERVER_NAME}/svn, https://${SERVER_NAME}/svn" | ||||
| ; REQUEST_PROTOCOL is resolved to either http or https. | ||||
| ; All specified URLs are shown in the repository list of the project overview | ||||
| ; page.  | ||||
| ; You may use various items available in $_SERVER when composing the URL. | ||||
| ; For example, ${HTTP_HOST} maps to  $_SERVER{'HTTP_HOST'}. | ||||
| ; Additionally, $_SERVER{'REQUEST_PROTOCOL'} added by config/config.php | ||||
| ; can be referenced with ${REQUEST_PROTOCOL} and it is resolved to either | ||||
| ; http or https. | ||||
| ;------------------------------------------------------------------------------ | ||||
| svn_base_url = "${REQUEST_PROTOCOL}://${SERVER_NAME}:${SERVER_PORT}/svn" | ||||
| ;svn_base_url = "${REQUEST_PROTOCOL}://${SERVER_NAME}:${SERVER_PORT}/svn" | ||||
| svn_base_url = "${REQUEST_PROTOCOL}://${HTTP_HOST}/svn" | ||||
|  | ||||
| ;------------------------------------------------------------------------------ | ||||
| ; Login model to use.  | ||||
|  | ||||
| @ -17,17 +17,25 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) | ||||
| { | ||||
| 	/* set to https if the first X-Forwarded-Proto is https */ | ||||
| 	if (array_search ("https", array_map ('strtolower', preg_split("/[\s,]+/", $_SERVER['HTTP_X_FORWARDED_PROTO']))) === 0) | ||||
| 	{ | ||||
| 		$config['base_url'] = 'https'; | ||||
| 		$_SERVER['REQUEST_PROTOCOL'] = 'https'; | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| 		$config['base_url'] = 'http'; | ||||
| 		$_SERVER['REQUEST_PROTOCOL'] = 'http'; | ||||
| 	} | ||||
| } | ||||
| else if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') | ||||
| { | ||||
| 	$config['base_url'] = 'https'; | ||||
| 	$_SERVER['REQUEST_PROTOCOL'] = 'https'; | ||||
| } | ||||
| else | ||||
| { | ||||
| 	$config['base_url'] = 'http'; | ||||
| 	$_SERVER['REQUEST_PROTOCOL'] = 'http'; | ||||
| } | ||||
|  | ||||
| $config['base_url'] .= "://{$_SERVER['HTTP_HOST']}"; | ||||
|  | ||||
| @ -120,7 +120,7 @@ foreach ($urls as $url) | ||||
| 	$url = trim($url); | ||||
| 	if ($url == '') continue; | ||||
| 	print '<li>'; | ||||
| 	print anchor ($this->converter->expand($url,$_SERVER) . "/{$project->id}"); | ||||
| 	print anchor ($this->converter->expand($url,$_SERVER) . "/{$project->id}/"); | ||||
| 	print '</li>'; | ||||
| } | ||||
| ?> | ||||
|  | ||||
| @ -46,6 +46,10 @@ define('APPPATH', $application_folder.'/'); | ||||
| */ | ||||
| if (CODEPOT_HTTPS_COMPULSORY) | ||||
| { | ||||
| 	// this option is not affected by X-Forwared-Proto or other similar headers. | ||||
| 	// this option mandates SSL over the direct connection to the origin server. | ||||
| 	// it doesn't care if the client is using SSL when the connection is relayed | ||||
| 	// by intermediate proxy servers. | ||||
| 	if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')  | ||||
| 	{ | ||||
| 		/* force https except api calls */ | ||||
| @ -63,16 +67,6 @@ if (CODEPOT_HTTPS_COMPULSORY) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| |--------------------------------------------------------------- | ||||
| | EXTRA INFORMATION | ||||
| |--------------------------------------------------------------- | ||||
| */ | ||||
| if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') | ||||
| 	$_SERVER['REQUEST_PROTOCOL'] = 'https'; | ||||
| else | ||||
| 	$_SERVER['REQUEST_PROTOCOL'] = 'http'; | ||||
|  | ||||
| /* | ||||
| |--------------------------------------------------------------- | ||||
| | LOAD THE FRONT CONTROLLER | ||||
|  | ||||
		Reference in New Issue
	
	Block a user