summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2019-06-11 12:31:22 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2019-06-11 20:14:11 +0100
commit5d7db3e727d3f9b9ba42a5aaedf925fde6146c9d (patch)
treeb582a63ea6ce432c0db875b3c9fdbaa1045612f6
parent4dd1f63b8b92481f00697efc035d1e6015f0abfa (diff)
downloaddeluge-5d7db3e727d3f9b9ba42a5aaedf925fde6146c9d.zip
deluge-5d7db3e727d3f9b9ba42a5aaedf925fde6146c9d.tar.gz
deluge-5d7db3e727d3f9b9ba42a5aaedf925fde6146c9d.tar.bz2
[Web] Change request.base path encoding to utf-8
A user reported a problem with setting base path resulting in this error: encoding with 'idna' codec failed (UnicodeError: label too long) It is likely the base path is longer than 63 chars, which is unusual, however the idna codec is for domain name not paths so switch to utf-8. Fixes: #3261
-rw-r--r--CHANGELOG.md1
-rw-r--r--deluge/ui/web/server.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d2edd9..12400dd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
- Fix TypeError in Peers Tab setting country flag.
- Fix reverse proxy header TypeError (#3260).
+- Fix request.base 'idna' codec error (#3261).
### Documentation
diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py
index c2a0df1..192c2b7 100644
--- a/deluge/ui/web/server.py
+++ b/deluge/ui/web/server.py
@@ -583,7 +583,7 @@ class TopLevel(resource.Resource):
if base[-1] != '/':
base += '/'
- request.base = base.encode('idna')
+ request.base = base.encode('utf-8')
return resource.Resource.getChildWithDefault(self, path, request)