From 3431b2a2bb41d7c3ac4a180665a4d9f4292bb606 Mon Sep 17 00:00:00 2001 From: haridhar yamjala Date: Mon, 17 Jul 2023 10:46:57 -0400 Subject: [PATCH] avoid decorate result for json payload (#90) * avoid decorate result for json payload * checking for presence of authorization for decorating payload --- .../protocols/http/soap/payload_header_middleware.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/event_source/protocols/http/soap/payload_header_middleware.rb b/lib/event_source/protocols/http/soap/payload_header_middleware.rb index 89b8d75f..37f75c64 100644 --- a/lib/event_source/protocols/http/soap/payload_header_middleware.rb +++ b/lib/event_source/protocols/http/soap/payload_header_middleware.rb @@ -3,10 +3,13 @@ module EventSource module Protocols module Http + # soap module module Soap # Add SOAP security headers and body around the payload. class PayloadHeaderMiddleware < Faraday::Middleware def on_request(env) + return env if env.request_headers["Authorization"] + sec_config = SecurityHeaderConfiguration.new(options[:soap_settings]) body_to_encode = env.body || "" decorate_result = Operations::DecoratePayloadUsingConfiguration.new.call(