Mika- / torrent-control

Firefox extension for adding torrents to remote clients.
https://addons.mozilla.org/addon/torrent-control/
179 stars 25 forks source link

Adding torrent to transmission changes "X-Transmission-Session-ID" Header #169

Closed canbaytok closed 3 weeks ago

canbaytok commented 1 month ago

Hi there, I recently switched to Firefox, because of upcoming ManifestV3 changes to Chrome and found this wonderful extension to add torrents quickly to my transmission instance, but unfortunately I noticed an issue.

I am using Firefox v131.0.3 (64-bit) and access my transmission instance via HTTPS from the world wide web (no local access). I also have a basic auth in place, that is configured in my nginx reverse proxy. The issue I am having is the following: The transmission instance can be accessed without any issues and I see a X-Transmission-Session-ID in the request headers, when the /transmission/rpc endpoint is called: image

This X-Transmission-Session-ID headers changes however after adding a torrent with Torrent Control and reloading the transmission instance tab, resulting in an 409 response and the error message, that the header is invalid: image

image

Oddly enough another call is made to the /rpc endpoint before the one that fails and the header is correct in this one and does not contain the null prefix, but no data is requested and the response is therefore "no method name"

The only way to access the transmission instance again is to disable the extension and reenable it, which releases the control of the header I guess and requests the /rpc endpoint with the correct session id.

Another solution I've found is to expose the transmission instance on a second subpath (transmission2.domain.tld) and use this as the target in the Torrent Control settings. Access via the first subpath is still possible, even after a torrent is added and the session id header is malformed. It's not a perfect solution, but a viable workaround, in case this issue can't be fixed any other way (at least for me), but maybe the fix is straightforward and easily implemented

Mika- commented 3 weeks ago

There's been some wonkyness with Transmission sessions I haven't been able to reproduce. I refactored Transmission handling to prevent crosstalking between addons and users sessions that should fix these problems.

canbaytok commented 3 weeks ago

Hi there, update is installed and the issue seems to be fixed. Thanks a lot!