Class: MtaSts::Fetcher
- Inherits:
-
Object
- Object
- MtaSts::Fetcher
- Defined in:
- lib/mta_sts/fetcher.rb
Overview
HTTPS GET of mta-sts.
Defined Under Namespace
Classes: Body, CertificateError, Error, HttpError, Timeout
Constant Summary collapse
- WELL_KNOWN_PATH =
"/.well-known/mta-sts.txt"- PORT =
443- OPEN_TIMEOUT =
10- READ_TIMEOUT =
10- TOTAL_TIMEOUT =
read_timeout renews per read; this one does not — stops a slow-drip body
30- MAX_BODY_BYTES =
64 * 1024
- USER_AGENT =
"mta_sts/#{VERSION} (+https://github.com/mailpiece/mta_sts)"
Instance Method Summary collapse
- #fetch(host) ⇒ Object
-
#initialize(open_timeout: OPEN_TIMEOUT, read_timeout: READ_TIMEOUT, total_timeout: TOTAL_TIMEOUT, max_body_bytes: MAX_BODY_BYTES) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(open_timeout: OPEN_TIMEOUT, read_timeout: READ_TIMEOUT, total_timeout: TOTAL_TIMEOUT, max_body_bytes: MAX_BODY_BYTES) ⇒ Fetcher
Returns a new instance of Fetcher.
37 38 39 40 41 42 43 |
# File 'lib/mta_sts/fetcher.rb', line 37 def initialize(open_timeout: OPEN_TIMEOUT, read_timeout: READ_TIMEOUT, total_timeout: TOTAL_TIMEOUT, max_body_bytes: MAX_BODY_BYTES) @open_timeout = open_timeout @read_timeout = read_timeout @total_timeout = total_timeout @max_body_bytes = max_body_bytes end |
Instance Method Details
#fetch(host) ⇒ Object
45 46 47 |
# File 'lib/mta_sts/fetcher.rb', line 45 def fetch(host) get(normalize(host)) end |