adjust consider json middleware

This commit is contained in:
Pete Matsyburka
2024-01-19 09:54:49 +02:00
parent 73fc2d92f7
commit 80254da1c1
+1 -1
View File
@@ -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