- commit
- 54b647a34371e49896344dcb358da7c8e3536fc5
- parent
- 8e7e3d3d9f36ba5dbec44899e4a25e448beca0a8
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2017-06-03 09:13
allow host url formatting
Diffstat
| M | jsonproxy/__init__.py | 6 | +++++- |
1 files changed, 5 insertions, 1 deletions
diff --git a/jsonproxy/__init__.py b/jsonproxy/__init__.py
@@ -56,7 +56,11 @@ def handle(request): 56 56 endpoint = request.match_info['endpoint'] 57 57 58 58 config = get_config(endpoint)59 -1 url = config['host'] + request.match_info['path']-1 59 if '{' in config['host']: -1 60 parts = request.match_info['path'].strip('/').split('/') -1 61 url = config['host'].format(*parts) -1 62 else: -1 63 url = config['host'] + request.match_info['path'] 60 64 if request.query_string: 61 65 url += '?' + request.query_string 62 66