Adding support for redirecting authenticated media paths
This commit is contained in:
parent
19ee8f0e3b
commit
27d4e75f5f
@ -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([])
|
||||
|
||||
|
@ -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([])
|
||||
|
||||
|
@ -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([])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user