deluge
deluge copied to clipboard
[WebUI] Fix base path not being honored
Twisted requires a child as bytes
, not str
to work as expected.
In addition, it adds the ability to call base in an infinite loop of
calls, i.e. hostname/base/base/base/...
.
The solution is to build the tree as served.
This is an alternative PR to #390.
Just noticed that serving both root and base is by design for both local and reverse proxy usage... So this PR is relevant if we want to keep the behavior... (🤦 on myself...)
Ok, so now there will be no more infinite loops
Can you elaborate on what this is fixing?
Sure.
Currently, if you set a base path (--base tmp
) for the WebUI
, you will get the following URL http://1270.0.1:8112/tmp
.
Now, if you will add another base (http://127.0.0.1/tmp/tmp
), the page will be loaded as usual, even though there is nothing in that URL.
This can be used to enter unlimited amount of children to the URL.
Ah I see! So I wasn't happy about adding a hack to a hack so crafted a simpler solution with tests: 4b6ac1f4c4
Let me know if I have missed anything with the implementation