Add Vary: Accept-Language to package API

This commit is contained in:
rubenwardy 2024-03-03 01:53:12 +00:00
parent 954a849ba6
commit 7c59c1c5b1

@ -97,7 +97,9 @@ def packages():
not_featured = [pkg for pkg in pkgs if f"{pkg['author']}/{pkg['name']}" not in featured_lut]
pkgs = featured + not_featured
return jsonify(pkgs)
resp = jsonify(pkgs)
resp.vary = "Accept-Language"
return resp
@bp.route("/api/packages/<author>/<name>/")
@ -114,7 +116,9 @@ def package_view(package):
html = render_markdown(data["long_description"])
data["long_description"] = html_to_minetest(html, formspec_version, include_images)
return jsonify(data)
resp = jsonify(data)
resp.vary = "Accept-Language"
return resp
@bp.route("/api/packages/<author>/<name>/hypertext/")