mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
server/embed: return 404 on post not found
This commit is contained in:
@ -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("</head>", f'''
|
||||
|
@ -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")])
|
||||
|
Reference in New Issue
Block a user