From d1e01063730eeaba8d76152296e92aaeb5404547 Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Mon, 2 Dec 2024 13:50:43 +0000 Subject: [PATCH] fix is_json() check for flask 3.0 --- src/microcosm/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/microcosm/__init__.py b/src/microcosm/__init__.py index c4a3471..f9f96df 100644 --- a/src/microcosm/__init__.py +++ b/src/microcosm/__init__.py @@ -465,9 +465,11 @@ def get_api_client() -> forgejo.RepositoryApi: @core_bp.route("/", methods=["POST"]) @authed_endpoint def req(): - if request.get_json(): + print("hello") + if request.is_json: docstr, frontmatter, file_path = process_json_post() else: + print(request.form) docstr, frontmatter, file_path = process_multipart_post() frontmatter_str = yaml.dump(frontmatter)