Skip to content

fix: 1.0.1 — domain verification fails on default permalink settings - #7

Merged
tetakta merged 1 commit into
mainfrom
fix/domain-verify-redirect
Aug 22, 2026
Merged

fix: 1.0.1 — domain verification fails on default permalink settings#7
tetakta merged 1 commit into
mainfrom
fix/domain-verify-redirect

Conversation

@tetakta

@tetakta tetakta commented Aug 22, 2026

Copy link
Copy Markdown
Member

Bug

Domain ownership verification (well-known file method) could get stuck
on "Pending" forever, even with the correct token in place, on a live
site (lastivka.it-ua.org).

Root cause

  • WordPress's redirect_canonical() 301s /.well-known/tetapi-verify.txt
    to add a trailing slash (doesn't recognize the rewrite endpoint).
  • The API's verifier deliberately uses follow_redirects=False (SSRF
    hardening added after this plugin shipped) — so it only ever sees the
    redirect's empty body, never the token.
  • Confirmed by comparing the Redis-stored token, the live served file
    (byte-identical), and reproducing the exact httpx call from prod —
    it only fails through the real redirect chain.

Fix

Skip WordPress's canonical redirect for this one rewrite endpoint.

Bumped to 1.0.1, changelog + upgrade notice added.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

… URL

WordPress's default redirect_canonical() 301s /.well-known/tetapi-verify.txt
to add a trailing slash (it doesn't recognize the rewrite endpoint as a
real page). The API's domain verifier deliberately does not follow
redirects (SSRF hardening — a caller-controlled domain must not be able
to redirect the check elsewhere), so it only ever saw the empty 301
body and never found the token, leaving verification stuck on "Pending"
forever even with a correct token in place.

Root-caused via a live WordPress site (lastivka.it-ua.org) whose "Check
now" kept failing: confirmed the redis token and the served file byte
matched exactly, then found the prod API code (which had grown SSRF
hardening — follow_redirects=False + private-IP guard — since this
plugin was first written) reproduces the failure only through the
redirect, not directly.

Fix: skip WordPress's canonical redirect specifically for this one
rewrite endpoint via `redirect_canonical`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tetakta
tetakta merged commit 9b861e9 into main Aug 22, 2026
1 check passed
@tetakta
tetakta deleted the fix/domain-verify-redirect branch August 22, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant