Skip to content

Commit 537294a

Browse files
committed
Make sure configured paths have no trailing slash, fixes #150
1 parent 8a72523 commit 537294a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/wopiserver.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ def init(cls):
146146
except OSError:
147147
cls.log.error('msg="Failed to open the provided certificate or key to start in https mode"')
148148
raise
149-
cls.wopiurl = cls.config.get('general', 'wopiurl')
150-
cls.homepath = cls.config.get('general', 'homepath', fallback='/home/username')
151-
cls.recoverypath = cls.config.get('io', 'recoverypath', fallback='/var/spool/wopirecovery')
149+
cls.wopiurl = cls.config.get('general', 'wopiurl').strip('/')
150+
cls.homepath = cls.config.get('general', 'homepath', fallback='/home/username').strip('/')
151+
cls.recoverypath = cls.config.get('io', 'recoverypath', fallback='/var/spool/wopirecovery').strip('/')
152152
try:
153153
os.makedirs(cls.recoverypath)
154154
except FileExistsError:
155155
pass
156156
# WOPI proxy configuration (optional)
157-
cls.wopiproxy = cls.config.get('general', 'wopiproxy', fallback='')
157+
cls.wopiproxy = cls.config.get('general', 'wopiproxy', fallback='').strip('/')
158158
cls.wopiproxykey = None
159159
proxykeyfile = cls.config.get('general', 'wopiproxysecretfile', fallback='')
160160
if proxykeyfile:

0 commit comments

Comments
 (0)