MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / buildMarsUrl

Function buildMarsUrl

scripts/mars-api.mjs:121–129  ·  view source on GitHub ↗
(baseUrl, path, query = {})

Source from the content-addressed store, hash-verified

119 * mirrors how doctl derives its endpoints from `--api-url`.
120 */
121export function buildMarsUrl(baseUrl, path, query = {}) {
122 const url = new URL(`${trimTrailingSlash(baseUrl)}${path}`);
123 for (const [key, value] of Object.entries(query)) {
124 if (value !== undefined && value !== null && value !== "") {
125 url.searchParams.set(key, String(value));
126 }
127 }
128 return url.toString();
129}
130
131/**
132 * Pull the human-readable message out of harness-api's error envelope. Falls

Callers 2

buildTunnelWsUrlFunction · 0.90
requestFunction · 0.85

Calls 2

trimTrailingSlashFunction · 0.85
setMethod · 0.80

Tested by

no test coverage detected