1
0
mirror of https://git.sr.ht/~metalune/simpleweb_peertube synced 2024-12-22 15:15:04 +01:00

/search supports GET forms, as required by OpenSearch

This commit is contained in:
southerntofu 2021-07-28 20:38:28 -04:00 committed by metalune
parent ee6b30b0c0
commit 0b47bda1aa

View File

@ -131,6 +131,11 @@ async def simpleer_search_redirect():
query = (await request.form)["query"] query = (await request.form)["query"]
return redirect("/search/" + query) return redirect("/search/" + query)
@app.route("/search", methods = ["GET"])
async def simpleer_search_get_redirect():
query = request.args.get("query")
return redirect("/search/" + query)
@app.route("/search/<string:query>", defaults = {"page": 1}) @app.route("/search/<string:query>", defaults = {"page": 1})
@app.route("/search/<string:query>/<int:page>") @app.route("/search/<string:query>/<int:page>")
async def simpleer_search(query, page): async def simpleer_search(query, page):