pub enum ProbeVerdict {
Ok {
status: u16,
bytes: usize,
},
BotChallenge {
status: u16,
},
Refused {
status: u16,
},
Status {
status: u16,
},
NotAllowlisted,
Unreachable {
reason: String,
},
}Expand description
Classification of a single publisher probe (issue #407).
The point of the enum is the BotChallenge arm. A publisher WAF answers
a scripted client with 202 Accepted and an empty body; a report that
only printed the status would call that a success and send the user off
to debug their subscription, when the binding constraint is that they
are not a browser. Status and body size together separate the two.
Variants§
Ok
2xx with a non-empty body — the host served this client.
BotChallenge
2xx with an empty body. Almost always a bot-challenge holding response, not a paywall and not an outage.
Refused
401 / 403 — reached the host, which refused. A subscription or credential question, not a transport one.
Status
Any other status.
NotAllowlisted
The host is not on the source allowlist, so no request was sent.
Unreachable
Transport failure — DNS, TLS, connect, or timeout.
Implementations§
Source§impl ProbeVerdict
impl ProbeVerdict
Sourcepub fn classify(status: u16, body_bytes: usize) -> Self
pub fn classify(status: u16, body_bytes: usize) -> Self
Map a doiget_core::http::ProbeOutcome to a verdict. Pure, so
the classification —
the part with the actual judgement in it — is unit-testable without
a network or a mock server.
Trait Implementations§
Source§impl Clone for ProbeVerdict
impl Clone for ProbeVerdict
Source§fn clone(&self) -> ProbeVerdict
fn clone(&self) -> ProbeVerdict
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more