/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"]
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>/<int:page>")
async def simpleer_search(query, page):