|
@@ -1,4 +1,5 @@
|
1
|
1
|
import threading
|
|
2
|
+from configparser import DuplicateSectionError
|
2
|
3
|
from wsgiref.simple_server import make_server
|
3
|
4
|
import signal
|
4
|
5
|
|
|
@@ -189,11 +190,17 @@ class RadicaleDaemon(Daemon):
|
189
|
190
|
radicale_config.set('storage', 'custom_handler', tracim_storage)
|
190
|
191
|
radicale_config.set('storage', 'filesystem_folder', fs_path)
|
191
|
192
|
|
192
|
|
- radicale_config.set(
|
193
|
|
- 'header',
|
194
|
|
- 'Access-Control-Allow-Origin',
|
195
|
|
- allow_origin,
|
196
|
|
- )
|
|
193
|
+ if allow_origin:
|
|
194
|
+ try:
|
|
195
|
+ radicale_config.add_section('headers')
|
|
196
|
+ except DuplicateSectionError:
|
|
197
|
+ pass # It is not a problem, we just want it exist
|
|
198
|
+
|
|
199
|
+ radicale_config.set(
|
|
200
|
+ 'headers',
|
|
201
|
+ 'Access-Control-Allow-Origin',
|
|
202
|
+ allow_origin,
|
|
203
|
+ )
|
197
|
204
|
|
198
|
205
|
def _get_server(self):
|
199
|
206
|
from tracim.config.app_cfg import CFG
|