Skip to content

Commit 6175109

Browse files
committed
api: rest: Fix run ID parsing issue
1 parent e9bebcd commit 6175109

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

pkg/api/rest/common/url.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
package common
22

33
import (
4-
"fmt"
54
"net/url"
5+
"strings"
66
)
77

88
func UrlDecode(text string) string {
9-
decodedStr, err := url.QueryUnescape(text)
10-
if err != nil {
11-
fmt.Println("Error decoding URL:", err)
12-
return err.Error()
13-
} else {
14-
return decodedStr
9+
if strings.Contains(text, "%") {
10+
decodedStr, err := url.QueryUnescape(text)
11+
if err != nil {
12+
return text
13+
} else {
14+
return decodedStr
15+
}
1516
}
17+
18+
return text
1619
}
1720

1821
func UrlEncode(text string) string {

0 commit comments

Comments
 (0)