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 <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Benedek Nagy 2022-05-24 10:32:41 +00:00 committed by Sunil Mohan Adapa
parent b4271069a1
commit b6d3e21608
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -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.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/transmission/$
RewriteRule .* /transmission/web/ [R=302,L]
RewriteCond %{REQUEST_URI} ^/transmission/web$
RewriteRule .* /transmission/web/ [R=302,L]
</IfModule>
</Location>