Service + region (and optional bucket) decoded from a Host header.
Covers both the LocalStack hostname convention
(<service>.<region>.localhost.localstack.cloud[:port],
<bucket>.s3.<region>.localhost.localstack.cloud[:port]) and real AWS
service hostnames (<service>.<region>.amazonaws.com, S3 path-style
and virtual-hosted-style including the legacy no-region
s3.amazonaws.com / <bucket>.s3.amazonaws.com forms and the older
dash-separated s3-<region>.amazonaws.com form).
Header-only service detection. Skips the form-encoded body sniff so
the dispatch path can decide whether to stream or buffer the body
without first reading it. Returns None when only a body sniff
would succeed; the caller must then fall back to detect_service
after buffering. Used to opt streaming routes (S3 PutObject /
UploadPart, ECR OCI v2 blob upload) out of the global body cap.
Parse a Host header value for a LocalStack- or AWS-shaped hostname.
Returns None for anything that doesn’t match — callers fall through
to their existing detection path.