Skip to content

Commit

Permalink
Merge pull request #271 from bduc/master
Browse files Browse the repository at this point in the history
Check for HTTP Success instead of only 200 and 201
  • Loading branch information
reidmorrison committed Jul 31, 2023
2 parents dd47330 + 3f5ae03 commit 1be5412
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/semantic_logger/appender/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def process_request(request, body = nil)
end
request.basic_auth(@username, @password) if @username
response = @http.request(request)
if response.code == "200" || response.code == "201"
if response.is_a?(Net::HTTPSuccess)
true
else
# Failures are logged to the global semantic logger failsafe logger (Usually stderr or file)
Expand Down

0 comments on commit 1be5412

Please sign in to comment.