Skip to content

fix: say when an app's address can't be looked up (#335) - #362

Merged
ifahimreza merged 1 commit into
mainfrom
fix/335-unresolved-host-message
Oct 13, 2026
Merged

ifahimreza merged 1 commit into
mainfrom
fix/335-unresolved-host-message

Conversation

@ifahimreza

@ifahimreza ifahimreza commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #335

What

When sign-in by address can't read an app's identity document because this server can't look up the app's host, the authorize page now says so, names the host, and suggests a key. It used to say the address "resolves to a private or unreachable network", which sent people looking for a network problem.

Why

PHP on WordPress Playground and Studio has no DNS, so claude.ai and chatgpt.com never resolve there. Found in the #223 real-app pass.

How

  • Saddle_HTTP::url_is_safe() is unchanged in behaviour and still fails closed. Its lookup moved into a private resolve() so fetch_json() can ask, after a refusal, whether the host resolved at all.
  • New error code saddle_http_unresolved for "could not look up"; saddle_http_blocked keeps the private-network case.
  • Changelog line under 1.6.0 (the number is Fahim's). .pot regenerated: one new string.

Testing

  • vendor/bin/phpunit --filter 'HTTP_Fetch_JSON|Media_SSRF|OAuth': 125 tests OK (PHP 8.2)
  • vendor/bin/phpcs clean on includes/
  • New tests/http-fetch-json-test.php: unresolvable host names itself and points to a key; private and link-local addresses keep the old message; the guard still refuses; the sign-in flow passes the reason through.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sign-in by address on WordPress Playground and Studio stopped with
"That address resolves to a private or unreachable network", because PHP
there has no DNS. fetch_json() now tells the two cases apart: a host that
can't be looked up names the host and points to a key; a private address
keeps the old message. Both stay refused; the guard is unchanged.

Closes #335

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ifahimreza
ifahimreza merged commit c0ad04f into main Oct 13, 2026
8 checks passed
@ifahimreza
ifahimreza deleted the fix/335-unresolved-host-message branch October 13, 2026 23:17
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.

Sign-in by address fails on Playground and Studio with a misleading 'private network' message

1 participant