-
Notifications
You must be signed in to change notification settings - Fork 2
sync: merge upstream v1.0.145 into integration #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6288a03
03c6c3f
936a6be
a1175bd
0ab3b88
59fb3ae
9ad828d
8d3eac2
67a95c3
a4ec619
6866a06
ada40de
e694d4d
f20d6e8
804ad58
91d743e
190fa4c
58e66dd
86f7cc1
e060f96
7435d94
7d82f17
e46080a
72eb004
b274371
e36c349
cbb591e
85cfa22
15b8c14
89d51ad
56540f8
1a1874d
92fa66d
1361117
fadeed1
df55ad8
01fd0d8
499ad4f
bd1f5f8
6f5f73a
439aebb
7b4f852
530b75a
13a7700
28c6320
d88912a
9b05217
f1b8707
7eb509d
d93c8c7
a02223a
d14462f
4309c07
5955d20
231390c
578072b
6251231
40f121c
65a6b3d
85c01e8
2d9c76b
9e0a2bc
a8f83cd
f7e29a1
5d57d03
c211b22
fbad378
0bcb304
0b1bf15
04810e8
6c2f117
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| v1.0.143 | ||
| v1.0.145 |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| "nodeModules": "sha256-JT8J+Nd2kk0x46BcyotmBbM39tuKOW7VzXfOV3R3sqQ=" | ||
| "nodeModules": "sha256-WcFRAG8w1XwgZxzyAawkQ7mYfJxu5VhA3sPApEG6FdI=" | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import type { APIEvent } from "@solidjs/start/server" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| async function handler(evt: APIEvent) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const req = evt.request.clone() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const url = new URL(req.url) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const targetUrl = `https://enterprise.opencode.ai/${url.pathname}${url.search}` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const response = await fetch(targetUrl, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| method: req.method, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| headers: req.headers, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body: req.body, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return response | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add error handling and consider security implications. The proxy lacks error handling for network failures and forwards all request headers (including cookies, authorization) to the target. Consider:
async function handler(evt: APIEvent) {
const req = evt.request.clone()
const url = new URL(req.url)
const targetUrl = `https://enterprise.opencode.ai/${url.pathname}${url.search}`
- const response = await fetch(targetUrl, {
- method: req.method,
- headers: req.headers,
- body: req.body,
- })
- return response
+ try {
+ const response = await fetch(targetUrl, {
+ method: req.method,
+ headers: req.headers,
+ body: req.body,
+ signal: AbortSignal.timeout(30000),
+ })
+ return response
+ } catch (error) {
+ return new Response("Proxy error", { status: 502 })
+ }
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const GET = handler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const POST = handler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const PUT = handler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const DELETE = handler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const OPTIONS = handler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const PATCH = handler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 125
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 157
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 160
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 125
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 914
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 304
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 1016
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 759
🏁 Script executed:
rg -n 'enterprise\.opencode\.ai' packages/console/app/src/routes/Repository: Latitudes-Dev/shuvcode
Length of output: 197
🏁 Script executed:
rg -n 'OPENCODE_API' packages/console/ --type=ts --type=tsxRepository: Latitudes-Dev/shuvcode
Length of output: 93
🏁 Script executed:
rg -n '\[\.\.\.' packages/console/app/src/routes/ -A 5 -B 2Repository: Latitudes-Dev/shuvcode
Length of output: 1371
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 1446
🏁 Script executed:
rg -n 'params\|pathname' packages/console/app/src/routes/ --type=tsRepository: Latitudes-Dev/shuvcode
Length of output: 48
🏁 Script executed:
rg -n 'url\.pathname|params\.' packages/console/app/src/routes/ -B 2 -A 2 --type=ts --type=tsxRepository: Latitudes-Dev/shuvcode
Length of output: 93
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 2905
🏁 Script executed:
rg -n 'export.*handler|export.*GET' packages/console/app/src/routes/docs/ -B 5 -A 5Repository: Latitudes-Dev/shuvcode
Length of output: 1626
🏁 Script executed:
Repository: Latitudes-Dev/shuvcode
Length of output: 1439
Remove the trailing slash to match the docs proxy pattern and avoid double slash in URLs.
The URL construction has an inconsistency: the
/t/[...path]route includes a trailing slash after the domain (https://enterprise.opencode.ai/), while the similar/docs/[...path]route does not (https://docs.opencode.ai). This creates a double slash whenurl.pathnamestarts with/:This aligns with how the docs proxy route is implemented and ensures clean URLs without double slashes.
📝 Committable suggestion
🤖 Prompt for AI Agents