File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments