diff --git a/lib/pact_broker/webhooks/webhook_execution_result.rb b/lib/pact_broker/webhooks/webhook_execution_result.rb index 1adbaaa6b..d2893dcb2 100644 --- a/lib/pact_broker/webhooks/webhook_execution_result.rb +++ b/lib/pact_broker/webhooks/webhook_execution_result.rb @@ -14,9 +14,11 @@ def initialize(request, response, logs, error = nil) end def success? - unless response.nil? + if response # Response HTTP Code must be in success list otherwise it is false PactBroker.configuration.webhook_http_code_success.include? response.code.to_i + else + false end end end diff --git a/lib/pact_broker/webhooks/webhook_request_logger.rb b/lib/pact_broker/webhooks/webhook_request_logger.rb index aac320f69..08ee26613 100644 --- a/lib/pact_broker/webhooks/webhook_request_logger.rb +++ b/lib/pact_broker/webhooks/webhook_request_logger.rb @@ -117,9 +117,11 @@ def log_error uuid, e, base_url end def success?(response) - unless response.nil? + if response # Response HTTP Code must be in success list otherwise it is false PactBroker.configuration.webhook_http_code_success.include? response.code.to_i + else + false end end