MCPcopy Create free account
hub / github.com/anomalyco/opencode / assertHttpUrl

Function assertHttpUrl

packages/core/src/tool/webfetch.ts:85–87  ·  view source on GitHub ↗
(url: URL)

Source from the content-addressed store, hash-verified

83 HttpClientRequest.get(url).pipe(HttpClientRequest.setHeaders(headers(format, userAgent)))
84
85const assertHttpUrl = (url: URL) => {
86 if (url.protocol !== "http:" && url.protocol !== "https:") throw new Error("URL must use http:// or https://")
87}
88
89const execute = (http: HttpClient.HttpClient, url: string, format: Format, userAgent = browserUserAgent) =>
90 http.execute(request(url, format, userAgent)).pipe(Effect.flatMap(HttpClientResponse.filterStatusOk))

Callers 1

webfetch.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected