Sha256: 7d8381ea1f75b28f4dac3146a94710ef62bc077147f7bd7c90f696f80ed8a20b
Contents?: true
Size: 616 Bytes
Versions: 1
Compression:
Stored size: 616 Bytes
Contents
module IndieWeb module Endpoints class HttpRequest HTTP_HEADERS_OPTS = { accept: '*/*', user_agent: 'IndieAuth, Micropub, and Webmention Endpoint Discovery (https://rubygems.org/gems/indieweb-endpoints)' }.freeze def self.get(uri) HTTP.follow.headers(HTTP_HEADERS_OPTS).timeout(connect: 10, read: 10).get(uri) rescue HTTP::ConnectionError, HTTP::TimeoutError, HTTP::Redirector::TooManyRedirectsError => exception raise IndieWeb::Endpoints.const_get(exception.class.name.split('::').last), exception end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
indieweb-endpoints-0.4.0 | lib/indieweb/endpoints/http_request.rb |