[Deluge] #3260: web ui reverse proxy crash

4 views
Skip to first unread message

Deluge

unread,
Jun 10, 2019, 6:32:59 PM6/10/19
to delug...@googlegroups.com
#3260: web ui reverse proxy crash
---------------------------+----------------------------
Reporter: ajslater | Owner:
Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Web UI | Version: 2.0.0
Keywords: reverse proxy |
---------------------------+----------------------------
if you access deluge web UI with a reverse proxy header it crashes


{{{
web.Server Traceback (most recent call last):
builtins.TypeError: must be str, not bytes
/usr/lib/python3/dist-packages/twisted/web/server.py:190 in process
189 try:
190 resrc = self.site.getResourceFor(self)
191 if resource._IEncodingResource.providedBy(resrc):
/usr/lib/python3/dist-packages/twisted/web/server.py:826 in getResourceFor
825 request.sitepath = copy.copy(request.prepath)
826 return resource.getChildForRequest(self.resource, request)
827
/usr/lib/python3/dist-packages/twisted/web/resource.py:98 in
getChildForRequest
97 request.prepath.append(pathElement)
98 resource = resource.getChildWithDefault(pathElement, request)
99 return resource
/usr/lib/python3/dist-packages/deluge/ui/web/server.py:580 in
getChildWithDefault
579 if base[0] != '/':
580 base = '/' + base
581
builtins.TypeError: must be str, not bytes
}}}

the base variable type is bytes from the header and not a string which
blows up.

When you retrieve the header contents here:
https://github.com/deluge-
torrent/deluge/blob/develop/deluge/ui/web/server.py#L572

its returning bytes and not str. Bytes are what's what's specified in the
twisted docs:
https://twistedmatrix.com/documents/current/api/twisted.web.http.Request.html#getHeader

so it might be fixable with casting those bytes to a string or
concatenating them another way.

This bug is new as of 2.x.x which makes sense since it looks like webui
was refactored some.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3260>
Deluge <http://deluge-torrent.org/>
Deluge Project

Deluge

unread,
Jun 11, 2019, 5:54:06 AM6/11/19
to delug...@googlegroups.com
#3260: web ui reverse proxy crash
-----------------------+---------------------------

Reporter: ajslater | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.0.3

Component: Web UI | Version: 2.0.0
Resolution: | Keywords: reverse proxy
-----------------------+---------------------------
Changes (by Cas):

* milestone: needs verified => 2.0.3


--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3260#comment:1>

Deluge

unread,
Jun 11, 2019, 7:14:31 AM6/11/19
to delug...@googlegroups.com
#3260: web ui reverse proxy crash
-----------------------+---------------------------

Reporter: ajslater | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.0.3

Component: Web UI | Version: 2.0.0
Resolution: | Keywords: reverse proxy
-----------------------+---------------------------

Comment (by Cas):

Thanks for detailed report! Will fix this shortly

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3260#comment:2>

Deluge

unread,
Jun 11, 2019, 3:28:21 PM6/11/19
to delug...@googlegroups.com
#3260: web ui reverse proxy crash
-----------------------+---------------------------
Reporter: ajslater | Owner:
Type: bug | Status: closed
Priority: minor | Milestone: 2.0.3

Component: Web UI | Version: 2.0.0
Resolution: Fixed | Keywords: reverse proxy
-----------------------+---------------------------
Changes (by Cas):

* status: new => closed
* resolution: => Fixed


Comment:

Fixed in develop [4dd1f63b8]

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3260#comment:3>

Reply all
Reply to author
Forward
0 new messages