/search supports GET forms, as required by OpenSearch
This commit is contained in:
parent
ee6b30b0c0
commit
0b47bda1aa
1 changed files with 5 additions and 0 deletions
5
main.py
5
main.py
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue