adjust consider json middleware
This commit is contained in:
@@ -7,7 +7,7 @@ class ApiPathConsiderJsonMiddleware
|
|||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
if env['PATH_INFO'].starts_with?('/api') &&
|
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['PATH_INFO'].ends_with?('/attachments')
|
||||||
env['CONTENT_TYPE'] = 'application/json'
|
env['CONTENT_TYPE'] = 'application/json'
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user