MCPcopy Index your code
hub / github.com/coder/code-server / fetch

Method fetch

test/utils/httpserver.ts:61–73  ·  view source on GitHub ↗

* fetch fetches the request path. * The request path must be rooted!

(requestPath: string, opts?: RequestInit, query?: { [key: string]: string })

Source from the content-addressed store, hash-verified

59 * The request path must be rooted!
60 */
61 public fetch(requestPath: string, opts?: RequestInit, query?: { [key: string]: string }): Promise<Response> {
62 const address = ensureAddress(this.hs, "http")
63 if (typeof address === "string") {
64 throw new Error("Cannot fetch socket path")
65 }
66 address.pathname = requestPath
67 if (query) {
68 Object.keys(query).forEach((key) => {
69 address.searchParams.append(key, query[key])
70 })
71 }
72 return nodeFetch(address.toString(), opts)
73 }
74
75 /**
76 * Open a websocket against the request path.

Callers 5

proxy.test.tsFile · 0.80
commonTestsFunction · 0.80
static.test.tsFile · 0.80
health.test.tsFile · 0.80
login.test.tsFile · 0.80

Calls 1

ensureAddressFunction · 0.90

Tested by 1

commonTestsFunction · 0.64