GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(opencode): add authorization header to fetch requests in RunComma… · ikvm/opencode@632f94f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode/src/cli/cmd
    • run.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/src/cli/cmd/run.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/run.ts
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,12 @@ export const RunCommand = effectCmd({
840840
const fetchFn = (async (input: RequestInfo | URL, init?: RequestInit) => {
841841
const { Server } = await import("@/server/server")
842842
const request = new Request(input, init)
843-
return Server.Default().app.fetch(request)
843+
const headers = new Headers(request.headers)
844+
const auth = ServerAuth.header()
845+
if (auth) headers.set("Authorization", auth)
846+
return Server.Default().app.fetch(
847+
new Request(request, { headers }),
848+
)
844849
}) as typeof globalThis.fetch
845850

846851
try {
@@ -875,7 +880,12 @@ export const RunCommand = effectCmd({
875880
const fetchFn = (async (input: RequestInfo | URL, init?: RequestInit) => {
876881
const { Server } = await import("@/server/server")
877882
const request = new Request(input, init)
878-
return Server.Default().app.fetch(request)
883+
const headers = new Headers(request.headers)
884+
const auth = ServerAuth.header()
885+
if (auth) headers.set("Authorization", auth)
886+
return Server.Default().app.fetch(
887+
new Request(request, { headers }),
888+
)
879889
}) as typeof globalThis.fetch
880890
const sdk = createOpencodeClient({
881891
baseUrl: "http://opencode.internal",

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.