Adding support for redirecting authenticated media paths

This commit is contained in:
q 2024-09-23 16:25:32 -04:00
parent 19ee8f0e3b
commit 27d4e75f5f
3 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ class MyServer:
else:
hsu = self.default_hs
hsp = hsu + mediatype + '/' + hs + '/' + mediaid + '?' + self.environ['QUERY_STRING']
hsp = hsu + '/_matrix/media/v3/' + mediatype + '/' + hs + '/' + mediaid + '?' + self.environ['QUERY_STRING']
self.start_response('301 Moved Permanently', [('Location', hsp)])
return iter([])

View File

@ -44,7 +44,7 @@ class MyServer:
else:
hsu = self.default_hs
hsp = hsu + mediatype + '/' + hs + '/' + mediaid + '?' + self.environ['QUERY_STRING']
hsp = hsu + '/_matrix/media/v3/' + mediatype + '/' + hs + '/' + mediaid + '?' + self.environ['QUERY_STRING']
self.start_response('301 Moved Permanently', [('Location', hsp)])
return iter([])

View File

@ -38,7 +38,7 @@ class MyServer:
except Exception as e: # I don't care to fix this properly, not my problem
hsu = "https://matrix-client.matrix.org"
hsp = hsu + self.environ['PATH_INFO'] + '?' + self.environ['QUERY_STRING']
hsp = hsu + '/_matrix/media/v3/' + mediatype + '/' + hs + '/' + mediaid + '?' + self.environ['QUERY_STRING']
self.start_response('301 Moved Permanently', [('Location', hsp)])
return iter([])