blob: 1e1ac82567cdd58ca4f57b342edddbbe7bd9ff6b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# frozen_string_literal: true
module HttpHelper
USER_AGENT = "#{HTTP::Request::USER_AGENT} (Mastodon/#{Mastodon::VERSION}; +http://#{Rails.configuration.x.local_domain}/)"
def http_client(options = {})
timeout = { write: 10, connect: 10, read: 10 }.merge(options)
HTTP.headers(user_agent: USER_AGENT)
.timeout(:per_operation, timeout)
.follow
end
end
|