deluge icon indicating copy to clipboard operation
deluge copied to clipboard

[WebUI] Fix base path not being honored

Open DjLegolas opened this issue 2 years ago • 2 comments

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.

DjLegolas avatar Jul 16 '22 22:07 DjLegolas

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...)

DjLegolas avatar Jul 16 '22 23:07 DjLegolas

Ok, so now there will be no more infinite loops

DjLegolas avatar Jul 17 '22 14:07 DjLegolas

Can you elaborate on what this is fixing?

cas-- avatar Feb 28 '23 15:02 cas--

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.

DjLegolas avatar Feb 28 '23 18:02 DjLegolas

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

cas-- avatar Mar 03 '23 10:03 cas--