use getHeaders which is backwards compatible with twisted

This commit is contained in:
Damien Churchill 2010-04-01 01:19:46 +01:00
parent af17346ac6
commit c1200ed63f
1 changed files with 2 additions and 4 deletions

View File

@ -562,10 +562,8 @@ class TopLevel(resource.Resource):
template = Template(filename=rpath("index.html"))
request.setHeader("content-type", "text/html; charset=utf-8")
if request.requestHeaders.hasHeader('x-deluge-base'):
base = request.requestHeaders.getRawHeaders('x-deluge-base')[-1]
else:
base = component.get("DelugeWeb").base
header = request.getHeader('x-deluge-base')
base = header if header else component.get("DelugeWeb").base
# validate the base parameter
if not base: