diff --git a/custommedia-blacklist.py b/custommedia-blacklist.py index 5a126a4..1426b19 100755 --- a/custommedia-blacklist.py +++ b/custommedia-blacklist.py @@ -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([]) diff --git a/custommedia-whitelist.py b/custommedia-whitelist.py index 172700b..011d4a6 100755 --- a/custommedia-whitelist.py +++ b/custommedia-whitelist.py @@ -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([]) diff --git a/custommedia.py b/custommedia.py index dab0a03..c795ffc 100755 --- a/custommedia.py +++ b/custommedia.py @@ -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([])