diff --git a/server/szurubooru/api/embed_api.py b/server/szurubooru/api/embed_api.py index dbead402..c83a8a50 100644 --- a/server/szurubooru/api/embed_api.py +++ b/server/szurubooru/api/embed_api.py @@ -81,7 +81,7 @@ def post_index(ctx: rest.Context, params: Dict[str, str]) -> rest.Response: try: oembed = get_post(ctx, {}, path) except posts.PostNotFoundError: - return {"return_type": "custom", "content": index_html} + return {"return_type": "custom", "status_code": "404", "content": index_html} url = config.config["site_url"] + path new_html = index_html.replace("", f''' diff --git a/server/szurubooru/rest/app.py b/server/szurubooru/rest/app.py index d95bb145..8aa188b5 100644 --- a/server/szurubooru/rest/app.py +++ b/server/szurubooru/rest/app.py @@ -113,7 +113,7 @@ def application( db.session.remove() if type(response) == dict and response.get("return_type") == "custom": - start_response("200", [("content-type", "text/html")]) + start_response(response.get("status_code", "200"), [("content-type", "text/html")]) return (response.get("content", "").encode("utf-8"),) start_response("200", [("content-type", "application/json")])