Repository navigation
Fall back to legacy root stellar.toml when .well-known is missing - #890
Merged
Just-Bamford merged 1 commit intoOct 27, 2026
Merged
Conversation
fetchStellarToml only ever fetched /.well-known/stellar.toml, so domains that predate SEP-1's .well-known standardization and still only serve a bare /stellar.toml at the root return a 404 and fail discovery entirely. .well-known is still tried first and preferred whenever it succeeds; the legacy root path is only attempted as a fallback when the standard path fails, so compliant domains are never affected. Also fixes 4 existing tests that reused the same mocked Response instance across multiple fetchStellarToml calls in the same test (valid before, since only one network call happened per domain; the new fallback path's extra retry on a reused, already-consumed Response body surfaced the sharing bug) by switching those to a fresh Response per call via mockImplementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #862
fetchStellarToml(src/integration/sep1Toml.ts) only ever fetched/.well-known/stellar.toml. Domains that predate SEP-1's.well-knownstandardization and still only serve a bare/stellar.tomlat the root returned a 404 and failed discovery entirely.The standard
.well-knownpath is still tried first and preferred whenever it succeeds (SEP-1 only defines that path; a root-only document was never standard). The legacy root path is attempted only as a fallback when the standard path fails (404, network error, or invalid TOML), so SEP-1-compliant domains are completely unaffected.Added tests for: well-known tried first, fallback to root on 404, no fallback attempted when well-known succeeds, and both paths failing returning an error. Also fixed 4 existing tests that were reusing the same mocked
Responseinstance across multiplefetchStellarTomlcalls, previously invisible since only one network call happened per domain, but surfaced by the new fallback path's extra retry hitting an already-consumedResponsebody.Documented the resolution order and interaction with cache revalidation in
docs/sep1-stellar-toml.md.Verified against upstream main:
npm run typecheckandnpm run lintboth clean;sep1Toml.test.ts13/13 passing.