Skip to content

Comments

Fix registry url#486

Merged
steipete merged 4 commits intoopenclaw:mainfrom
Liknox:fix-registry-url
Feb 25, 2026
Merged

Fix registry url#486
steipete merged 4 commits intoopenclaw:mainfrom
Liknox:fix-registry-url

Conversation

@Liknox
Copy link
Contributor

@Liknox Liknox commented Feb 23, 2026

Fix: preserve registry base path when hosted at non-root URL

Introduced registryUrl() helper in http.ts that correctly joins base URL
(with possible custom path) and endpoint path, preventing loss of base path
when using new URL() with absolute paths.

Main changes:

  • Added registryUrl() helper with proper path normalization
  • Updated URL construction in inspect.ts, moderation.ts and skills.ts to use new helper
  • Fixed moderation.ts to pass full URLs instead of just pathnames
  • Added detailed tests covering:
    • standard origins
    • custom/deep base paths
    • trailing slashes
    • encoded path segments

Closes bug where /base part was being dropped when constructing API URLs
against registries hosted at non-root paths (e.g. http://example.com/custom/registry/api/v1/skills)

Test coverage: comprehensive
Risk: low

Greptile Summary

This PR correctly fixes a URL construction bug where registry base paths were being dropped when hosted at non-root URLs. The registryUrl() helper properly normalizes paths by ensuring the base URL has a trailing slash and the relative path doesn't have a leading slash before constructing the URL, which prevents the URL constructor from treating the path as absolute.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is straightforward, well-tested with comprehensive test coverage including edge cases (trailing slashes, deep paths, encoded segments), and all affected call sites have been properly updated. The fix addresses a real bug in URL construction without introducing complexity.
  • No files require special attention

Last reviewed commit: fde567c

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@vercel
Copy link
Contributor

vercel bot commented Feb 23, 2026

@Liknox is attempting to deploy a commit to the Amantus Machina Team on Vercel.

A member of the Team first needs to authorize it.

@steipete steipete merged commit bc37ec7 into openclaw:main Feb 25, 2026
1 check failed
@steipete
Copy link
Collaborator

Landed via temp rebase onto main.

  • Gate: bun run lint && bun run test && bun run build && bun run docs:list
  • Land commit: 897f090
  • Merge commit: bc37ec7

Thanks @Liknox!

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.

2 participants