mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-01 23:38:37 +00:00
fixed a bug when parsing SERVICE_URL
This commit is contained in:
parent
1bf0a0fe22
commit
87db2ca986
@ -40,6 +40,7 @@ import ConfigParser
|
|||||||
|
|
||||||
import ccnet
|
import ccnet
|
||||||
import seafile
|
import seafile
|
||||||
|
import re
|
||||||
from pysearpc import SearpcError
|
from pysearpc import SearpcError
|
||||||
|
|
||||||
ENVIRONMENT_VARIABLES = ('CCNET_CONF_DIR', 'SEAFILE_CONF_DIR')
|
ENVIRONMENT_VARIABLES = ('CCNET_CONF_DIR', 'SEAFILE_CONF_DIR')
|
||||||
@ -75,7 +76,12 @@ config.read(os.path.join(CCNET_CONF_PATH, 'ccnet.conf'))
|
|||||||
if config.has_option('General', 'SERVICE_URL') and \
|
if config.has_option('General', 'SERVICE_URL') and \
|
||||||
config.has_option('Network', 'PORT'):
|
config.has_option('Network', 'PORT'):
|
||||||
service_url = config.get('General', 'SERVICE_URL')
|
service_url = config.get('General', 'SERVICE_URL')
|
||||||
service_url = service_url.lstrip('http://').lstrip('https://')
|
|
||||||
|
if service_url.startswith('http://'):
|
||||||
|
service_url = service_url[7:]
|
||||||
|
elif service_url.startswith('https://'):
|
||||||
|
service_url = service_url[8:]
|
||||||
|
|
||||||
if ':' in service_url:
|
if ':' in service_url:
|
||||||
# strip http port such as ':8000' in 'http://192.168.1.101:8000'
|
# strip http port such as ':8000' in 'http://192.168.1.101:8000'
|
||||||
idx = service_url.index(':')
|
idx = service_url.index(':')
|
||||||
|
Loading…
Reference in New Issue
Block a user