feat: allow RUNLOOP_BASE_URL to include a port override#240
Merged
Conversation
Relax the RUNLOOP_BASE_URL validation so a `:port` may be supplied (e.g. https://api.runloop.pro:8443). The port flows through to all API calls via baseUrl(); derived platform/SSH/tunnel hostnames are unaffected since they use URL.hostname (port-stripped). Path, query, fragment, and non-https URLs are still rejected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dines-rl
approved these changes
Jun 4, 2026
adam-rl
pushed a commit
that referenced
this pull request
Jun 4, 2026
🤖 I have created a release *beep* *boop* --- ## [1.18.0](v1.17.0...v1.18.0) (2026-06-04) ### Features * allow RUNLOOP_BASE_URL to include a port override ([#240](#240)) ([eaef9eb](eaef9eb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Summary
Relax
RUNLOOP_BASE_URLvalidation so an optional:portmay be supplied (e.g.https://api.runloop.pro:8443), enabling non-standard-port deployments and local testing.Changes
src/utils/config.ts—checkBaseDomain()no longer rejects a port. It still requires thehttps://api.<domain>shape and still rejects path, query, and fragment. The port flows through to all API calls viabaseUrl()(which returns the raw env value). Derived platform/SSH/tunnel hostnames are unaffected sincerunloopBaseDomain()usesURL.hostname, which excludes the port.README.md— documents the optional:port.tests/__tests__/utils/baseUrl.test.ts(new) — covers port acceptance, continued rejection of path/query/non-https, thatbaseUrl()includes the port, and thatrunloopBaseDomain()strips both theapi.prefix and the port.Notes
httpsis still required, so localhttp://overrides remain rejected. Happy to relax that too if local dev needs it.Verification
pnpm run build(tsc) passes🤖 Generated with Claude Code