Fixed issue with API redirect

This commit is contained in:
Krateng 2020-09-04 15:23:08 +02:00
parent 52a9faae90
commit 5cf7ca2e9b
No known key found for this signature in database
GPG Key ID: 46735607861C6FCE
3 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ author = {
"email":"maloja@krateng.dev",
"github": "krateng"
}
version = 2,9,1
version = 2,9,2
versionstr = ".".join(str(n) for n in version)
links = {
"pypi":"malojaserver",

View File

@ -134,7 +134,7 @@ def compose_querystring(*dicts,exclude=[]):
values = keys.getall(k)
st += "&".join([urllib.parse.urlencode({k:v},safe="/") for v in values])
st += "&"
return st
return st[:-1] if st.endswith("&") else st # remove last ampersand
# takes any number of multidicts and normal dicts and creates a formsdict with duplicate values removed

View File

@ -68,7 +68,7 @@ def deprecated_api_s(pth):
@webserver.get("/api/<pth:path>")
@webserver.post("/api/<pth:path>")
def deprecated_api(pth):
redirect("/apis/mlj_1/" + pth + "?" + compose_querystring(request.query))
redirect("/apis/mlj_1/" + pth + "?" + request.query_string)