Skip to content

Commit ced5030

Browse files
committed
safer code
Signed-off-by: Ludwig Patte <ludwig.patte@ovhcloud.com>
1 parent 7df416a commit ced5030

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • internal/services/browser

internal/services/browser/api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package browser
99
import (
1010
"encoding/json"
1111
"fmt"
12+
"net/url"
1213
"math/rand"
1314
"os"
1415
"os/exec"
@@ -620,7 +621,7 @@ func (m Model) fetchDatabasesData(category string) dataLoadedMsg {
620621

621622
// First, get the list of database service IDs (the API returns an array of strings)
622623
var serviceIDs []string
623-
endpoint := fmt.Sprintf("/v1/cloud/project/%s/database/service?category=%s", m.cloudProject, category)
624+
endpoint := fmt.Sprintf("/v1/cloud/project/%s/database/service?category=%s", m.cloudProject, url.QueryEscape(category))
624625
err := httpLib.Client.Get(endpoint, &serviceIDs)
625626
if err != nil {
626627
return dataLoadedMsg{

0 commit comments

Comments
 (0)