#!/usr/bin/env bash
# Pass 5: HTTP/1.1 homepage ?nocache across fleet + cache-status headers (h2 vs h1.1)
DOMAINS="studiosoft.id yasmanatura.co.id tslaw.id rsia.kendangsari.com theskincodeclinic.com everybeofficial.com dmark.id surabaya-skincentre.com abimataconsultant.com"
EPOCH=$(date +%s)
echo "=== PASS5 H1.1 $(date -u '+%H:%M:%S UTC') ben=BEN_${EPOCH} ==="
for D in $DOMAINS; do
  OUT=$(curl -4 --http1.1 -sL -o /dev/null --connect-timeout 5 --max-time 15 \
        -D /tmp/ben_hdr_$$.txt \
        -w '%{http_code} t=%{time_total} size=%{size_download}' \
        "https://${D}/?nocache=BEN_${EPOCH}" 2>/dev/null)
  CF=$(grep -i '^cf-cache-status' /tmp/ben_hdr_$$.txt | tr -d '\r' | head -1)
  AGE=$(grep -i '^age:' /tmp/ben_hdr_$$.txt | tr -d '\r' | head -1)
  SRV=$(grep -i '^server:' /tmp/ben_hdr_$$.txt | tr -d '\r' | head -1)
  echo "${D} | h1.1 ${OUT} | ${CF:-no-cf-hdr} | ${AGE:-no-age} | ${SRV:-no-server}"
done
rm -f /tmp/ben_hdr_$$.txt
echo "=== DONE $(date -u '+%H:%M:%S UTC') ==="
