Adding support for redirecting authenticated media paths
This commit is contained in:
parent
19ee8f0e3b
commit
27d4e75f5f
@ -45,7 +45,7 @@ class MyServer:
|
|||||||
else:
|
else:
|
||||||
hsu = self.default_hs
|
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)])
|
self.start_response('301 Moved Permanently', [('Location', hsp)])
|
||||||
return iter([])
|
return iter([])
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class MyServer:
|
|||||||
else:
|
else:
|
||||||
hsu = self.default_hs
|
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)])
|
self.start_response('301 Moved Permanently', [('Location', hsp)])
|
||||||
return iter([])
|
return iter([])
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class MyServer:
|
|||||||
except Exception as e: # I don't care to fix this properly, not my problem
|
except Exception as e: # I don't care to fix this properly, not my problem
|
||||||
hsu = "https://matrix-client.matrix.org"
|
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)])
|
self.start_response('301 Moved Permanently', [('Location', hsp)])
|
||||||
return iter([])
|
return iter([])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user