From b6d3e21608d5e25b7d5783d127457dabd0968d17 Mon Sep 17 00:00:00 2001 From: Benedek Nagy Date: Tue, 24 May 2022 10:32:41 +0000 Subject: [PATCH] transmission: Add redirects to avoid 409 conflict Tests: - Inside container, run 'curl http://localhost/transmission/' and 'curl http://localhost/transmission/web'. Notice that '409 Conflict' errors are thrown. - Apply the patch, run ./setup.py install and restart apache. Run the curl commands again and this time, they lead to 302 redirects instead. [sunil]: Update comment and make the redirect temporary. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa Tested-by: Sunil Mohan Adapa --- .../apache2/conf-available/transmission-plinth.conf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plinth/modules/transmission/data/etc/apache2/conf-available/transmission-plinth.conf b/plinth/modules/transmission/data/etc/apache2/conf-available/transmission-plinth.conf index 21558b3da..31dfacb53 100644 --- a/plinth/modules/transmission/data/etc/apache2/conf-available/transmission-plinth.conf +++ b/plinth/modules/transmission/data/etc/apache2/conf-available/transmission-plinth.conf @@ -16,4 +16,15 @@ ## redirect URLs, set cookies, set absolute URLs (if any) ## properly. RequestHeader set X-Forwarded-Proto 'https' env=HTTPS + + # Make redirects to avoid 409 Conflict errors. See: #2219. Upstream issue: + # https://github.com/transmission/transmission/pull/857 . Drop this + # workaround with Transmission >= 4.0. + + RewriteEngine On + RewriteCond %{REQUEST_URI} ^/transmission/$ + RewriteRule .* /transmission/web/ [R=302,L] + RewriteCond %{REQUEST_URI} ^/transmission/web$ + RewriteRule .* /transmission/web/ [R=302,L] +