[Web] Fix TypeError with reverse proxy x-deluge-base header

The request header needs decoded otherwise string comparisons fail.

Fixes: #3260
This commit is contained in:
Calum Lind 2019-06-11 12:19:21 +01:00
parent fc134cdffb
commit 4dd1f63b8b
2 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@
### Web UI
- Fix TypeError in Peers Tab setting country flag.
- Fix reverse proxy header TypeError (#3260).
### Documentation

View File

@ -571,7 +571,7 @@ class TopLevel(resource.Resource):
def getChildWithDefault(self, path, request): # NOQA: N802
# Calculate the request base
header = request.getHeader(b'x-deluge-base')
base = header if header else component.get('DelugeWeb').base
base = header.decode('utf-8') if header else component.get('DelugeWeb').base
# validate the base parameter
if not base: