#!/usr/bin/env bash
set -euo pipefail

case "${SITE_URL:-}" in
  https://phyllisschlafly.com|https://www.phyllisschlafly.com)
    ;;
  *)
    printf 'SITE_URL is not an approved production URL.\n' >&2
    exit 64
    ;;
esac

unset WP_REST_USER WP_REST_APPLICATION_PASSWORD

exec curl --disable --fail --silent --show-error --output /dev/null \
  --proto '=https' \
  --proto-redir '=https' \
  --location \
  --max-redirs 0 \
  --no-location-trusted \
  "${SITE_URL}/wp-json/"
