From 80254da1c1895e9c6a588fa5643b400d31057e42 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Fri, 19 Jan 2024 09:54:49 +0200 Subject: [PATCH] adjust consider json middleware --- lib/api_path_consider_json_middleware.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api_path_consider_json_middleware.rb b/lib/api_path_consider_json_middleware.rb index e93ee86c..48bb1b0a 100644 --- a/lib/api_path_consider_json_middleware.rb +++ b/lib/api_path_consider_json_middleware.rb @@ -7,7 +7,7 @@ class ApiPathConsiderJsonMiddleware def call(env) if env['PATH_INFO'].starts_with?('/api') && - !env['PATH_INFO'].ends_with?('/documents') && + (!env['PATH_INFO'].ends_with?('/documents') || env['REQUEST_METHOD'] != 'POST') && !env['PATH_INFO'].ends_with?('/attachments') env['CONTENT_TYPE'] = 'application/json' end