A 200 response can still be incomplete or impossible to decode. Before treating a blank public page as an editorial problem, check whether its selected representation arrived intact. Keep declared length, received encoded bytes, content decoding and approved decoded identity in separate fields.
This procedure concerns an ordinary successful GET response with content. HEAD,304 and other bodyless contexts have different rules. The response-state review reinforces the need to interpret status and meaningful content together rather than treating every empty response as the same failure.
Use a harmless deterministic fixture before inspecting a real incident. Do not publish sensitive response bodies or authentication material in the review packet. A local reproduction can preserve the failure mechanism without copying private content.
Distinguish content coding from transfer framing
RFC 9110 defines Content-Length in octets and describes Content-Encoding as the coding applied to a representation. For a compressed successful GET body, the relevant encoded length is not the number of decoded characters a text editor displays. A UTF-8 character can itself occupy more than one byte before compression.
Transfer framing is another layer. A response can legitimately omit Content-Length when its protocol and framing delimit content another way. Do not declare every absent length header a truncation. Conversely, a present value must be interpreted under the actual response context and protocol.
Record whether the client exposes encoded bytes or automatically decoded content. A library that decompresses transparently may hand you a decoded body while preserving a header that describes the encoded representation. Comparing those two quantities directly creates a false discrepancy.
Use a complete offline integrity fixture
This standard-library exercise creates a small fictional public HTML representation, compresses it locally and checks four deliberately different cases. It opens no network connection and writes no application files. The baseline records the actual sizes from the runtime rather than inventing a fixed compression ratio.
import gzip
import hashlib
plain = '<h1>Public setup</h1><p>Approve the connection first.</p>'.encode('utf-8')
encoded = gzip.compress(plain, mtime=0)
expected_digest = hashlib.sha256(plain).hexdigest()
cases = [
('complete', len(encoded), encoded),
('truncated', len(encoded), encoded[:-1]),
('wrong-length', len(encoded) + 7, encoded),
('length-absent', None, encoded),
]
for name, declared, received in cases:
length_ok = declared is None or declared == len(received)
try:
decoded = gzip.decompress(received)
decoding_ok = True
identity_ok = hashlib.sha256(decoded).hexdigest() == expected_digest
except (OSError, EOFError):
decoding_ok = False
identity_ok = False
accepted = length_ok and decoding_ok and identity_ok
expected = name in ('complete', 'length-absent')
assert accepted == expected, (name, length_ok, decoding_ok, identity_ok)
print(name, declared, len(received), accepted)
This is an offline representation fixture, not a complete HTTP parser. It deliberately evaluates an absent length as no length contradiction, then still requires successful decoding and approved identity. A real HTTP client must also enforce the applicable protocol framing and report its own transport errors.
Read the failure dimensions separately
The complete case must pass all applicable checks. The truncated case has one fewer encoded byte than declared and should also fail gzip integrity. The wrong-length case contains valid compressed content but declares seven extra bytes;it fails the explicit length contract even though decoding succeeds.
The length-absent case is not automatically broken. In a correctly framed real response, it can be entirely valid. The local exercise establishes only that these representation bytes decode correctly;it cannot validate a network protocol boundary it never received.
Keep those distinctions in the incident table. A decompression error does not identify which intermediary caused corruption. A length mismatch does not prove malicious alteration. A correct digest against the approved fixture establishes agreement with that fixture, not publisher trust or software safety.
Keep identity and freshness distinct
A complete representation can be the wrong release. Use the approved artifact identity review when the issue is which file should be served. The integrity test here cannot decide whether its independently supplied expected reference is the right product version.
Likewise, a complete old HTML response can have valid compression and length. The validator freshness check addresses stale-version reuse. Do not interpret every successful checksum as proof that the current instructions reached readers.
Google’s fetch and status guidance helps frame later crawl observations, but this offline and endpoint test does not establish a provider’s actual fetch history. Keep the transport finding and later search evidence in separate records.
Release an integrity contract that can fail
Save the approved representation identity, client collection method, actual byte boundaries, decoding result and applicable framing evidence. Retain the truncation and wrong-length fixtures so future checks do not collapse all failures into one generic empty-page alert.
Acceptance requires the intended successful GET to arrive completely, decode under its declared content coding and agree with the approved representation reference. Missing optional length information is not a pass by itself;the remaining protocol and identity checks still matter.
Close the defect with the affected layer’s repair and fresh ordinary-response evidence. That yields a reproducible transport result without claiming that a nominal 200, readable title or unchanged filename proves complete content delivery.
