From 69746d3ebde6ecb6c74591e19fe6a9e28ea6ffe5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier <contact@jbpasquier.eu> Date: Mon, 24 Jun 2024 12:38:07 +0200 Subject: [PATCH] fix: allow OPTIONS/POST/PUT requests --- djangoldp/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/djangoldp/views.py b/djangoldp/views.py index 2b402be..503e01c 100644 --- a/djangoldp/views.py +++ b/djangoldp/views.py @@ -626,6 +626,11 @@ class WebFingerView(View): def serve_static_content(request, path): + if request.method != "GET": + resolver = get_resolver() + match = resolver.resolve("/" + path) + return match.func(request, *match.args, **match.kwargs) + server_url = getattr(settings, "BASE_URL", "http://localhost") output_dir = "ssr" @@ -643,7 +648,7 @@ def serve_static_content(request, path): if time_difference > 24 * 60 * 60: os.remove(file_path) - if not os.path.exists(file_path) and request.method == "GET": + if not os.path.exists(file_path): resolver = get_resolver() match = resolver.resolve("/" + path) -- GitLab