Skip to content

Commit 37d46d2

Browse files
authored
fix: change legacy api url (#9)
1 parent 32e28a0 commit 37d46d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/api/server/handlers_cmd.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ func (h *handlers) openApplication(ctx *fiber.Ctx) error {
376376
})
377377
}
378378

379-
httpposturl := fmt.Sprintf("http://%s/legacy/v1alpha1/api.intent/v1/server/intent/send", os.Getenv("OS_SYSTEM_SERVER"))
379+
//httpposturl := fmt.Sprintf("http://%s/legacy/v1alpha1/api.intent/v1/server/intent/send", os.Getenv("OS_SYSTEM_SERVER"))
380+
httpposturl := fmt.Sprintf("http://edge-desktop.user-space-%s/server/intent/send", os.Getenv("OWNER"))
380381

381382
fmt.Println("HTTP JSON POST URL:", httpposturl)
382383

@@ -411,6 +412,13 @@ func (h *handlers) openApplication(ctx *fiber.Ctx) error {
411412
}
412413
defer response.Body.Close()
413414

415+
if response.StatusCode != http.StatusOK {
416+
return ctx.JSON(fiber.Map{
417+
"code": response.StatusCode,
418+
"message": fmt.Sprintf("Request intent failed: %v", error),
419+
})
420+
}
421+
414422
fmt.Println("response Status:", response.Status)
415423
fmt.Println("response Headers:", response.Header)
416424
body, _ := io.ReadAll(response.Body)

0 commit comments

Comments
 (0)