Close http connection in perform method of Request class (#6889)
HTTP connections must be explicitly closed in many cases, and letting perform method close connections makes its callers less redundant and prevent them from forgetting to close connections.
This commit is contained in:
committed by
Eugen Rochko
parent
4e71b104e6
commit
54b273bf99
@ -60,9 +60,9 @@ module JsonLdHelper
|
||||
end
|
||||
|
||||
def fetch_resource_without_id_validation(uri)
|
||||
response = build_request(uri).perform
|
||||
return if response.code != 200
|
||||
body_to_json(response.to_s)
|
||||
build_request(uri).perform do |response|
|
||||
response.code == 200 ? body_to_json(response.to_s) : nil
|
||||
end
|
||||
end
|
||||
|
||||
def body_to_json(body)
|
||||
|
Reference in New Issue
Block a user